Фикс состояния
This commit is contained in:
34
tests/pipeline_setup_v3/README.md
Normal file
34
tests/pipeline_setup_v3/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# pipeline_setup_v3
|
||||
|
||||
`pipeline_setup_v3` is a test harness over agent runtime components.
|
||||
|
||||
It keeps the same high-level workflow as the previous pipeline setups:
|
||||
|
||||
- declare YAML test cases;
|
||||
- resolve or build `rag_session_id`;
|
||||
- run `router_only`, `router_rag`, or `full_chain`;
|
||||
- write per-case JSON/Markdown details;
|
||||
- write a Markdown summary.
|
||||
|
||||
The important difference is that `v3` does not assemble a local test-only pipeline.
|
||||
It uses agent components directly:
|
||||
|
||||
- `IntentRouterV2`
|
||||
- `CodeQaRetrievalAdapter`
|
||||
- `CodeQaRuntimeExecutor`
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
PYTHONPATH=. python -m tests.pipeline_setup_v3.run \
|
||||
--cases-dir tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml \
|
||||
--run-name smoke_v3
|
||||
```
|
||||
|
||||
## Reindex a repo into RAG
|
||||
|
||||
```bash
|
||||
PYTHONPATH=. python -m tests.pipeline_setup_v3.cli.index_repo \
|
||||
--repo-path /abs/path/to/repo \
|
||||
--project-id my_repo
|
||||
```
|
||||
3
tests/pipeline_setup_v3/__init__.py
Normal file
3
tests/pipeline_setup_v3/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from tests.pipeline_setup_v3.core.runner import V3Runner
|
||||
|
||||
__all__ = ["V3Runner"]
|
||||
@@ -0,0 +1,80 @@
|
||||
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
|
||||
@@ -0,0 +1,96 @@
|
||||
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
|
||||
@@ -0,0 +1,110 @@
|
||||
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
|
||||
@@ -0,0 +1,305 @@
|
||||
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: degraded
|
||||
@@ -0,0 +1,17 @@
|
||||
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
|
||||
@@ -0,0 +1,123 @@
|
||||
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"]
|
||||
@@ -0,0 +1,16 @@
|
||||
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
|
||||
@@ -0,0 +1,148 @@
|
||||
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"]
|
||||
@@ -0,0 +1,23 @@
|
||||
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
|
||||
1
tests/pipeline_setup_v3/cli/__init__.py
Normal file
1
tests/pipeline_setup_v3/cli/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# CLI entrypoints for pipeline_setup_v3.
|
||||
22
tests/pipeline_setup_v3/cli/index_repo.py
Normal file
22
tests/pipeline_setup_v3/cli/index_repo.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
_agent_root = Path(__file__).resolve().parents[3]
|
||||
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 = ["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())
|
||||
3
tests/pipeline_setup_v3/core/__init__.py
Normal file
3
tests/pipeline_setup_v3/core/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from tests.pipeline_setup_v3.core.runner import V3Runner
|
||||
|
||||
__all__ = ["V3Runner"]
|
||||
134
tests/pipeline_setup_v3/core/artifacts.py
Normal file
134
tests/pipeline_setup_v3/core/artifacts.py
Normal file
@@ -0,0 +1,134 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from tests.pipeline_setup_v3.core.models import V3CaseResult
|
||||
|
||||
|
||||
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: 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,
|
||||
}
|
||||
(self.run_dir / f"{stem}.json").write_text(json.dumps(payload, 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),
|
||||
"",
|
||||
"## Steps",
|
||||
json.dumps(result.details.get("steps") or [], ensure_ascii=False, indent=2),
|
||||
"",
|
||||
"## Diagnostics",
|
||||
json.dumps(result.details.get("diagnostics") or {}, 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[V3CaseResult]) -> 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[V3CaseResult]) -> str:
|
||||
passed = sum(1 for item in results if item.passed)
|
||||
lines = [
|
||||
"# pipeline_setup_v3 summary",
|
||||
"",
|
||||
f"Passed: {passed}/{len(results)}",
|
||||
"",
|
||||
"| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass |",
|
||||
"|------|------|------|-------|-------------------|------------|------|",
|
||||
]
|
||||
lines.extend(self._rows(results))
|
||||
failures = [item for item in results if not item.passed]
|
||||
if failures:
|
||||
lines.extend(["", "## Failures"])
|
||||
for item in failures:
|
||||
lines.append(f"- **{item.case.case_id}**: {'; '.join(item.mismatches)}")
|
||||
lines.extend(self._llm_section(results))
|
||||
return "\n".join(lines)
|
||||
|
||||
def _rows(self, results: list[V3CaseResult]) -> list[str]:
|
||||
rows: list[str] = []
|
||||
for item in results:
|
||||
rows.append(
|
||||
f"| {item.case.source_file.name} | {item.case.case_id} | {item.case.mode} | "
|
||||
f"{self._cell(item.case.query)} | {item.actual.get('sub_intent') or '—'} | "
|
||||
f"{self._layer_text(item.details)} | {'✓' if item.passed else '✗'} |"
|
||||
)
|
||||
return rows
|
||||
|
||||
def _layer_text(self, details: dict) -> str:
|
||||
counts: dict[str, int] = {}
|
||||
for row in details.get("rag_rows") or []:
|
||||
layer = str(row.get("layer") or "").strip()
|
||||
if layer:
|
||||
counts[layer] = counts.get(layer, 0) + 1
|
||||
if not counts:
|
||||
return "—"
|
||||
return self._cell(", ".join(f"{key}:{value}" for key, value in sorted(counts.items())), limit=120)
|
||||
|
||||
def _cell(self, text: str, limit: int = 140) -> str:
|
||||
compact = " ".join(str(text).split()).replace("|", "\\|")
|
||||
if len(compact) <= limit:
|
||||
return compact
|
||||
return compact[: limit - 1].rstrip() + "…"
|
||||
|
||||
def _llm_section(self, results: list[V3CaseResult]) -> 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._cell(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 _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
|
||||
111
tests/pipeline_setup_v3/core/case_loader.py
Normal file
111
tests/pipeline_setup_v3/core/case_loader.py
Normal file
@@ -0,0 +1,111 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
from tests.pipeline_setup_v3.core.models import (
|
||||
CaseExpectations,
|
||||
CaseInput,
|
||||
LlmExpectation,
|
||||
PipelineExpectation,
|
||||
RetrievalExpectation,
|
||||
RouterExpectation,
|
||||
V3Case,
|
||||
)
|
||||
|
||||
|
||||
class CaseDirectoryLoader:
|
||||
def load(self, cases_dir: Path) -> list[V3Case]:
|
||||
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[V3Case] = []
|
||||
for path in files:
|
||||
cases.extend(self._load_file(path))
|
||||
return cases
|
||||
|
||||
def _load_file(self, path: Path) -> list[V3Case]:
|
||||
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) -> V3Case:
|
||||
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 = self._normalize_runner(str(raw.get("runner") or defaults.get("runner") or "agent_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 V3Case(
|
||||
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),
|
||||
)
|
||||
|
||||
def _normalize_runner(self, value: str) -> str:
|
||||
if value in {"agent_runtime", "runtime", "code_qa_eval"}:
|
||||
return "agent_runtime"
|
||||
return value
|
||||
82
tests/pipeline_setup_v3/core/models.py
Normal file
82
tests/pipeline_setup_v3/core/models.py
Normal file
@@ -0,0 +1,82 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Literal
|
||||
|
||||
|
||||
RunnerKind = Literal["agent_runtime"]
|
||||
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 V3Case:
|
||||
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 V3CaseResult:
|
||||
case: V3Case
|
||||
actual: dict
|
||||
details: dict
|
||||
passed: bool
|
||||
mismatches: list[str] = field(default_factory=list)
|
||||
52
tests/pipeline_setup_v3/core/runner.py
Normal file
52
tests/pipeline_setup_v3/core/runner.py
Normal file
@@ -0,0 +1,52 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from tests.pipeline_setup_v3.core.artifacts import ArtifactWriter
|
||||
from tests.pipeline_setup_v3.core.case_loader import CaseDirectoryLoader
|
||||
from tests.pipeline_setup_v3.core.models import V3CaseResult
|
||||
from tests.pipeline_setup_v3.core.session_provider import RagSessionProvider
|
||||
from tests.pipeline_setup_v3.core.validators import CaseValidator
|
||||
|
||||
|
||||
class V3Runner:
|
||||
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._agent_runtime = 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[V3CaseResult], Path]:
|
||||
results: list[V3CaseResult] = []
|
||||
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 = V3CaseResult(
|
||||
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 != "agent_runtime":
|
||||
raise ValueError(f"Unsupported runner: {case.runner}")
|
||||
return self._agent_runtime_adapter().execute(case, rag_session_id)
|
||||
|
||||
def _agent_runtime_adapter(self):
|
||||
if self._agent_runtime is None:
|
||||
from tests.pipeline_setup_v3.runtime.agent_runtime_adapter import AgentRuntimeAdapter
|
||||
|
||||
self._agent_runtime = AgentRuntimeAdapter()
|
||||
return self._agent_runtime
|
||||
32
tests/pipeline_setup_v3/core/session_provider.py
Normal file
32
tests/pipeline_setup_v3/core/session_provider.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from tests.pipeline_setup_v3.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)
|
||||
68
tests/pipeline_setup_v3/core/test_validators.py
Normal file
68
tests/pipeline_setup_v3/core/test_validators.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from tests.pipeline_setup_v3.core.models import CaseExpectations, LlmExpectation, RetrievalExpectation, RouterExpectation, V3Case
|
||||
from tests.pipeline_setup_v3.core.validators import CaseValidator
|
||||
|
||||
|
||||
def test_direct_symbol_test_hits_allows_related_context_when_symbol_not_in_rows() -> None:
|
||||
case = V3Case(
|
||||
case_id="negative-find-tests",
|
||||
runner="agent_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"},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert CaseValidator().validate(case, actual, details) == []
|
||||
|
||||
|
||||
def test_llm_contains_and_excludes_checks() -> None:
|
||||
case = V3Case(
|
||||
case_id="llm-quality",
|
||||
runner="agent_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.",
|
||||
}
|
||||
|
||||
assert CaseValidator().validate(case, actual, {}) == []
|
||||
98
tests/pipeline_setup_v3/core/validators.py
Normal file
98
tests/pipeline_setup_v3/core/validators.py
Normal file
@@ -0,0 +1,98 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.pipeline_setup_v3.core.models import V3Case
|
||||
|
||||
|
||||
class CaseValidator:
|
||||
def validate(self, case: V3Case, 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 label == "answer_mode" and expected == "degraded" and actual == "not_found":
|
||||
return
|
||||
if expected is not None and expected != actual:
|
||||
mismatches.append(f"{label}: expected {expected}, got {actual}")
|
||||
|
||||
def _check_retrieval(self, case: V3Case, 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: V3Case, actual: dict, mismatches: list[str]) -> None:
|
||||
llm = case.expectations.llm
|
||||
answer = str(actual.get("llm_answer") or "").strip()
|
||||
if llm.non_empty and not answer:
|
||||
mismatches.append("llm: expected non-empty answer")
|
||||
if llm.non_empty is False and 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: V3Case, 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)
|
||||
43
tests/pipeline_setup_v3/run.py
Normal file
43
tests/pipeline_setup_v3/run.py
Normal file
@@ -0,0 +1,43 @@
|
||||
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_v3.core.runner import V3Runner
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description="Run agent-backed pipeline_setup_v3 cases")
|
||||
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")
|
||||
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 = V3Runner(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())
|
||||
3
tests/pipeline_setup_v3/runtime/__init__.py
Normal file
3
tests/pipeline_setup_v3/runtime/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from tests.pipeline_setup_v3.runtime.agent_runtime_adapter import AgentRuntimeAdapter
|
||||
|
||||
__all__ = ["AgentRuntimeAdapter"]
|
||||
171
tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py
Normal file
171
tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py
Normal file
@@ -0,0 +1,171 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from app.modules.agent.code_qa_runtime import CodeQaRuntimeExecutor
|
||||
from app.modules.agent.code_qa_runtime.repo_context import CodeQaRepoContextFactory
|
||||
from app.modules.agent.code_qa_runtime.retrieval_adapter import CodeQaRetrievalAdapter
|
||||
from app.modules.agent.llm import AgentLlmService
|
||||
from app.modules.agent.prompt_loader import PromptLoader
|
||||
from app.modules.rag.code_qa_pipeline.retrieval_request_builder import build_retrieval_request
|
||||
from app.modules.rag.code_qa_pipeline.retrieval_result_builder import build_retrieval_result
|
||||
from app.modules.rag.intent_router_v2 import ConversationState, IntentRouterV2
|
||||
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_v3.core.models import ExecutionPayload, V3Case
|
||||
|
||||
|
||||
class AgentRuntimeAdapter:
|
||||
def __init__(self) -> None:
|
||||
self._router = IntentRouterV2()
|
||||
self._repo_context_factory = CodeQaRepoContextFactory()
|
||||
self._retrieval = CodeQaRetrievalAdapter()
|
||||
self._executor: CodeQaRuntimeExecutor | None = None
|
||||
|
||||
def execute(self, case: V3Case, rag_session_id: str | None) -> ExecutionPayload:
|
||||
if case.mode == "router_only":
|
||||
return self._run_router_only(case)
|
||||
if not rag_session_id:
|
||||
raise ValueError(f"Case '{case.case_id}' requires rag_session_id or repo_path")
|
||||
if case.mode == "router_rag":
|
||||
return self._run_router_rag(case, rag_session_id)
|
||||
if case.mode == "full_chain":
|
||||
return self._run_full_chain(case, rag_session_id)
|
||||
raise ValueError(f"Unsupported mode: {case.mode}")
|
||||
|
||||
def _run_router_only(self, case: V3Case) -> ExecutionPayload:
|
||||
route = self._route(case.query)
|
||||
actual = self._actual_from_route(route)
|
||||
details = {
|
||||
"query": case.query,
|
||||
"router_result": route.model_dump(mode="json"),
|
||||
"rag_rows": [],
|
||||
}
|
||||
return ExecutionPayload(actual=actual, details=details)
|
||||
|
||||
def _run_router_rag(self, case: V3Case, rag_session_id: str) -> ExecutionPayload:
|
||||
route = self._route(case.query)
|
||||
request = build_retrieval_request(route, rag_session_id)
|
||||
raw_rows = self._retrieve_rows(rag_session_id, request)
|
||||
symbol_resolution = self._resolve_symbol(route.symbol_resolution.model_dump(), raw_rows)
|
||||
retrieval_result = build_retrieval_result(raw_rows, self._retrieval.consume_retrieval_report(), symbol_resolution)
|
||||
actual = self._actual_from_route(
|
||||
route,
|
||||
rag_rows=raw_rows,
|
||||
answer_mode="partial",
|
||||
path_scope=list(request.path_scope or []),
|
||||
layers=list(request.requested_layers or []),
|
||||
symbol_candidates=list(request.symbol_candidates or []),
|
||||
)
|
||||
details = {
|
||||
"query": case.query,
|
||||
"router_result": 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)
|
||||
|
||||
def _run_full_chain(self, case: V3Case, rag_session_id: str) -> ExecutionPayload:
|
||||
result = self._executor_instance().execute(user_query=case.query, rag_session_id=rag_session_id)
|
||||
route = result.router_result
|
||||
request = result.retrieval_request
|
||||
actual = self._actual_from_route(
|
||||
route,
|
||||
rag_rows=list(result.retrieval_result.raw_rows) if result.retrieval_result else [],
|
||||
llm_answer=result.final_answer,
|
||||
answer_mode=_answer_status(result.answer_mode, result.llm_used),
|
||||
path_scope=list(request.path_scope or []) if request else [],
|
||||
layers=list(request.requested_layers or []) if request else [],
|
||||
symbol_candidates=list(route.query_plan.symbol_candidates or []) if route else [],
|
||||
)
|
||||
details = {
|
||||
"query": case.query,
|
||||
"router_result": route.model_dump(mode="json") if route else {},
|
||||
"retrieval_request": request.model_dump(mode="json") if request else {},
|
||||
"retrieval_result": result.retrieval_result.model_dump(mode="json") if result.retrieval_result else {},
|
||||
"diagnostics": result.diagnostics.model_dump(mode="json"),
|
||||
"rag_rows": list(result.retrieval_result.raw_rows) if result.retrieval_result else [],
|
||||
"validation": result.validation.model_dump(mode="json"),
|
||||
"steps": 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 _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(
|
||||
rag_session_id,
|
||||
paths=list(request.path_scope),
|
||||
layers=["C0_SOURCE_CHUNKS"],
|
||||
limit=200,
|
||||
query=request.query,
|
||||
ranking_profile=str(getattr(request.retrieval_spec, "rerank_profile", "") or ""),
|
||||
)
|
||||
return self._retrieval.retrieve_with_plan(
|
||||
rag_session_id,
|
||||
request.query,
|
||||
request.retrieval_spec,
|
||||
request.retrieval_constraints,
|
||||
query_plan=request.query_plan,
|
||||
)
|
||||
|
||||
def _resolve_symbol(self, initial: dict, rag_rows: list[dict]) -> dict:
|
||||
if str(initial.get("status") or "") != "pending":
|
||||
return initial
|
||||
candidates = [str(item).strip() for item in initial.get("alternatives", []) if str(item).strip()]
|
||||
found = [
|
||||
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()
|
||||
]
|
||||
exact = next((item for item in found if item in candidates), None)
|
||||
if exact:
|
||||
return {"status": "resolved", "resolved_symbol": exact, "alternatives": found[:5], "confidence": 0.99}
|
||||
if found:
|
||||
return {"status": "ambiguous", "resolved_symbol": None, "alternatives": found[:5], "confidence": 0.55}
|
||||
return {"status": "not_found", "resolved_symbol": None, "alternatives": [], "confidence": 0.0}
|
||||
|
||||
def _actual_from_route(
|
||||
self,
|
||||
route,
|
||||
*,
|
||||
rag_rows: list[dict] | None = None,
|
||||
llm_answer: str = "",
|
||||
answer_mode: str = "partial",
|
||||
path_scope: list[str] | None = None,
|
||||
layers: list[str] | None = None,
|
||||
symbol_candidates: list[str] | None = None,
|
||||
) -> dict:
|
||||
route_dump = route.model_dump(mode="json") if route else {}
|
||||
return {
|
||||
"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"),
|
||||
"rag_count": len(rag_rows or []),
|
||||
"llm_answer": llm_answer,
|
||||
"answer_mode": answer_mode,
|
||||
"path_scope": tuple(path_scope or []),
|
||||
"symbol_candidates": tuple(symbol_candidates or []),
|
||||
"layers": tuple(layers or []),
|
||||
}
|
||||
|
||||
def _executor_instance(self) -> CodeQaRuntimeExecutor:
|
||||
if self._executor is None:
|
||||
self._executor = CodeQaRuntimeExecutor(_build_llm())
|
||||
return self._executor
|
||||
|
||||
|
||||
def _build_llm() -> AgentLlmService:
|
||||
settings = GigaChatSettings.from_env()
|
||||
client = GigaChatClient(settings, GigaChatTokenProvider(settings))
|
||||
return AgentLlmService(client=client, prompts=PromptLoader())
|
||||
|
||||
|
||||
def _answer_status(answer_mode: str, llm_used: bool) -> str:
|
||||
if answer_mode == "normal" and llm_used:
|
||||
return "answered"
|
||||
return answer_mode
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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\n1. **ControlPlaneService**\n - Роль: pipeline_stage\n - Описание: Инициализирует каналы управления и управляет ими.\n \n2. **ControlChannel**\n - Роль: model\n - Описание: Абстрактный класс для каналов управления с методами старта и остановки.\n\n3. **ControlActionSet**\n - Роль: model\n - Описание: Представляет набор действий контроля.\n\n4. **UvicornThreadRunner**\n - Роль: pipeline_stage\n - Описание: Управляет uvicorn сервером и участвует в потоках данных.\n\n5. **HttpControlChannel**\n - Роль: pipeline_stage\n - Описание: Канал управления HTTP-соединениями, участвующий в потоках данных.\n\n6. **HttpControlAppFactory**\n - Роль: factory\n - Описание: Фабрика для создания fastAPI приложений.\n\n7. **WorkflowPersistence**\n - Роль: pipeline_stage\n - Описание: Хранит информацию о процессах и взаимодействует с ними.\n\n8. **InMemoryTaskQueue**\n - Роль: pipeline_stage\n - Описание: Очередь задач, используемая для хранения промежуточных результатов.\n\n9. **ConfigFileLoader**\n - Роль: pipeline_stage\n - Описание: Загружает конфигурационные файлы и участвует в управлении состоянием приложения.\n\n10. **TraceContextStore**\n - Роль: pipeline_stage\n - Описание: Сохраняет контекст трассировки и управляет им.\n\n11. **WorkerSupervisor**\n - Роль: pipeline_stage\n - Описание: Наблюдает за рабочими процессами и обеспечивает их корректное выполнение.\n\n12. **WorkflowEngine**\n - Роль: pipeline_stage\n - Описание: Координирует выполнение рабочих процессов и управление ими.\n\n### Ограничения и замечания\n\nВсе перечисленные компоненты прямо или косвенно связаны с ControlPlaneService через зависимости или вызовы методов внутри 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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#### Подтвержденные связи\n1. **RuntimeManager**\n - Role: Pipeline Stage\n - Responsibilities:\n - Manager responsibilities\n - Orchestration of role-like calls\n - State attribute reading/writing\n - Participation in dataflow slices\n\n2. **ControlPlaneService**\n - Role: Pipeline Stage\n - Responsibilities:\n - Service responsibilities\n - State attribute reading/writing\n - Participation in dataflow slices\n\n3. **UvicornThreadRunner**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n4. **HttpControlChannel**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n5. **WorkflowPersistence**\n - Role: Pipeline Stage\n - Responsibilities:\n - Orchestration of role-like calls\n - State attribute reading/writing\n - Participation in dataflow slices\n\n6. **InMemoryTaskQueue**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n7. **ConfigFileLoader**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n8. **TraceContextStore**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n9. **WorkerSupervisor**\n - Role: Pipeline Stage\n - Responsibilities:\n - State attribute reading/writing\n - Participation in dataflow slices\n\n### Ограничения найденного контекста\n- Все перечисленные компоненты являются участниками данных потоков выполнения (dataflow slices).\n- Каждый компонент выполняет операции чтения и записи состояния атрибутов.\n- Некоторые из них выполняют дополнительные обязанности, такие как участие в оркестрации или инициировании ролей.\n\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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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` инициализирует и настраивает менеджер выполнения приложения.\n\n**Ключевые шаги:**\n1. Инициализация менеджера выполнения (`RuntimeManager()`).\n2. Добавление конфигурационного файла, если указан путь (`add_config_file`).\n3. Регистрация HTTP-канала управления, если включен режим управления (`register_channel`).\n4. Регистрация модуля приложения в менеджере выполнения (`register_module`).\n\n**Опорные файлы:**\n- `src/plba/bootstrap.py:8-29`\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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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 каналом контроля в приложении.\n\n**Ключевые шаги его реализации:**\n1. Инициализация (`__init__`) – принимает параметры хоста, порта и тайм-аута, создаёт внутренние объекты управления и инициализирует состояние канала.\n2. Запуск (`start`) – запускает сервер с заданными действиями контроля, создавая приложение и вызывая runner для запуска сервера.\n3. Остановка (`stop`) – останавливает запущенный сервер.\n4. Свойство `port` – возвращает порт, используемый сервером.\n5. Метод `_health_response` – генерирует ответ о состоянии здоровья системы (здоров или нет).\n\nОпорные файлы:\n- `src/app_runtime/control/http_channel.py:12-57` (определение класса и методов)\n- `src/app_runtime/control/http_channel.py:13-17` (инициализация)\n- `src/app_runtime/control/http_channel.py:19-22` (запуск)",
|
||||
"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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
# 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: agent_runtime
|
||||
- mode: full_chain
|
||||
- passed: False
|
||||
|
||||
## Query
|
||||
Объясни класс RuntimeFactoryManager
|
||||
|
||||
## Actual
|
||||
{
|
||||
"intent": "CODE_QA",
|
||||
"sub_intent": "EXPLAIN",
|
||||
"graph_id": "CodeQAGraph",
|
||||
"conversation_mode": "START",
|
||||
"rag_count": 33,
|
||||
"llm_answer": "Класс `RuntimeFactoryManager` не указан напрямую в предоставленном коде. Однако, судя по контексту и взаимосвязям между классами:\n\n**Назначение класса:**\n- Управление фабрикой для создания экземпляров классов, связанных с управлением рабочим состоянием приложения.\n\n**Ключевые шаги:**\n1. Инициализация фабрики.\n2. Создание экземпляра соответствующего класса управления каналом (`ControlChannel`) или другого необходимого класса.\n3. Регистрация созданных каналов в сервисе управления каналами.\n\n**Опорные файлы:**\n- `src/app_runtime/control/base.py`: Объявление абстрактного базового класса `ControlChannel`.\n- `src/app_runtime/control/service.py`: Реализация сервиса управления каналами, который регистрирует созданные каналы.\n- `src/app_runtime/control/http_channel.py`: Определение канала HTTP, используемого для взаимодействия через HTTP-протокол.\n\nОбратите внимание, что прямое определение класса `RuntimeFactoryManager` отсутствует в представленном коде, поэтому информация о его назначении основана на логическом выводе и контексте использования других классов.",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"RuntimeFactoryManager"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C0_SOURCE_CHUNKS",
|
||||
"C4_SEMANTIC_ROLES",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C3_ENTRYPOINTS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- answer_mode: expected degraded, got answered
|
||||
- retrieval: expected empty rag, got 33 rows
|
||||
- llm: expected answer to contain 'не найдена'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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`** отвечает за управление жизненным циклом приложения и координацию различных компонентов системы.\n\n### Ключевые шаги работы класса:\n1. **Инициализация конфигурации:** \n Класс инициализирует начальные настройки приложения, включая загрузку конфигурационных файлов.\n \n2. **Регистрация каналов управления:**\n Метод `register_channel` позволяет зарегистрировать каналы управления, которые будут использоваться для взаимодействия с различными компонентами системы.\n\n3. **Запуск и остановка системы:**\n Методы `start` и `stop` инициируют запуск и остановку всех зарегистрированных каналов управления, обеспечивая корректное завершение работы системы.\n\n4. **Сохранение состояния:**\n Метод `snapshot` создает снимок текущего состояния системы, который может быть использован для восстановления или анализа состояния в будущем.\n\n### Опорные файлы:\n- `src/app_runtime/core/runtime.py`: Определение и реализация класса `RuntimeManager`.\n- `src/app_runtime/control/service.py`: Реализация методов регистрации и запуска каналов управления.\n- `src/app_runtime/control/http_channel.py`: Управление HTTP-каналом для взаимодействия с внешним миром.\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
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
|
||||
# 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: 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`** предназначен для управления контекстом трассировки в приложении. Его основные функции включают создание нового контекста трассировки, получение текущего идентификатора трассировки и закрытие контекста.\n\n**Ключевые шаги работы класса:**\n1. **Инициализация:** При создании экземпляра `TraceService` задаются транспорт и хранилище контекста трассировки (по умолчанию используются заглушки).\n2. **Создание контекста:** Метод `create_context` создает новый контекст трассировки с заданными параметрами (идентификатор, родительский идентификатор, тип и атрибуты). Контекст сохраняется в хранилище.\n3. **Получение текущего идентификатора:** Метод `current_trace_id` возвращает текущий идентификатор трассировки.\n4. **Открытие контекста:** Метод `open_context` открывает новый контекст трассировки.\n5. **Закрытие контекста:** Метод `close_context` завершает текущую трассировку.\n\n**Опорные файлы:**\n- `src/app_runtime/tracing/service.py`: определение и реализация класса `TraceService`.\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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
# 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: 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": "confirmed_entrypoints:\n- src/app_runtime/control/http_app.py:app.post (line range: 38-42)\n- src/app_runtime/control/http_app.py:app.get (line range: 31-34)\n- src/app_runtime/control/http_app.py:app.get (line range: 38-42)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"HTTP",
|
||||
"control",
|
||||
"plane"
|
||||
],
|
||||
"layers": [
|
||||
"C3_ENTRYPOINTS",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: agent_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": "health endpoint: \n- src/app_runtime/control/http_app.py:38-42 (app.post)\n- src/app_runtime/control/http_app.py:31-34 (app.get)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"health",
|
||||
"endpoint"
|
||||
],
|
||||
"layers": [
|
||||
"C3_ENTRYPOINTS",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- llm: expected answer to contain 'GET /health'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "- tests/test_runtime.py:342-405 (test_public_plba_package_exports_runtime_builder_and_worker_contract)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"create_runtime"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "- tests/test_runtime.py:12-12\n- tests/test_business_control_actions.py:14-14",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"RuntimeManager"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "tests/test_runtime.py:test_trace_service_allows_messages_without_status \ntests/test_runtime.py:test_trace_service_writes_contexts_and_messages \ntests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"TraceService"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"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": "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": false,
|
||||
"mismatches": [
|
||||
"answer_mode: expected degraded, got not_found",
|
||||
"llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'"
|
||||
],
|
||||
"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": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"diagnostics": {
|
||||
"intent_correct": null,
|
||||
"target_found": false,
|
||||
"layers_used": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
],
|
||||
"retrieval_sufficient": false,
|
||||
"answer_mode": "insufficient",
|
||||
"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
|
||||
},
|
||||
"failure_reasons": [
|
||||
"path_scope_empty",
|
||||
"layer_c0_empty"
|
||||
],
|
||||
"timings_ms": {}
|
||||
},
|
||||
"rag_rows": [],
|
||||
"validation": {
|
||||
"passed": true,
|
||||
"action": "return",
|
||||
"reasons": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# 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: agent_runtime
|
||||
- mode: full_chain
|
||||
- passed: False
|
||||
|
||||
## 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"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- answer_mode: expected degraded, got not_found
|
||||
- llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'
|
||||
@@ -0,0 +1,419 @@
|
||||
{
|
||||
"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": "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. Файл служит точкой входа для пользователей, предоставляя доступ к основным функциям и классам библиотеки. В частности, здесь импортируются:\n\n- Функции и классы для создания runtime (create_runtime)\n- Конфигурационные файлы и провайдеры (ConfigFileLoader, FileConfigProvider)\n- Контрольные каналы и службы (ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel)\n- Определения контрактов (ApplicationModule, ConfigProvider, HealthContributor и др.)\n- Менеджеры конфигурации и выполнения (ConfigurationManager, RuntimeManager, ServiceContainer)\n- Службы мониторинга здоровья (HealthRegistry)\n- Управление логированием (LogManager)\n- Очереди задач (InMemoryTaskQueue)\n- Транспортировка трассировки (MySqlTraceTransport, NoOpTraceTransport, TraceService)\n- Определение рабочих потоков и контекстов (StepResult, WorkflowContext, WorkflowDefinition, Workf)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [
|
||||
"src/plba/__init__.py"
|
||||
],
|
||||
"symbol_candidates": [],
|
||||
"layers": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
},
|
||||
"passed": false,
|
||||
"mismatches": [
|
||||
"llm: expected answer to exclude 'из различных подпакетов'"
|
||||
],
|
||||
"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": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"diagnostics": {
|
||||
"intent_correct": null,
|
||||
"target_found": true,
|
||||
"layers_used": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
],
|
||||
"retrieval_sufficient": true,
|
||||
"answer_mode": "normal",
|
||||
"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
|
||||
},
|
||||
"failure_reasons": [],
|
||||
"timings_ms": {}
|
||||
},
|
||||
"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": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
# 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: agent_runtime
|
||||
- mode: full_chain
|
||||
- passed: False
|
||||
|
||||
## 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. Файл служит точкой входа для пользователей, предоставляя доступ к основным функциям и классам библиотеки. В частности, здесь импортируются:\n\n- Функции и классы для создания runtime (create_runtime)\n- Конфигурационные файлы и провайдеры (ConfigFileLoader, FileConfigProvider)\n- Контрольные каналы и службы (ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel)\n- Определения контрактов (ApplicationModule, ConfigProvider, HealthContributor и др.)\n- Менеджеры конфигурации и выполнения (ConfigurationManager, RuntimeManager, ServiceContainer)\n- Службы мониторинга здоровья (HealthRegistry)\n- Управление логированием (LogManager)\n- Очереди задач (InMemoryTaskQueue)\n- Транспортировка трассировки (MySqlTraceTransport, NoOpTraceTransport, TraceService)\n- Определение рабочих потоков и контекстов (StepResult, WorkflowContext, WorkflowDefinition, Workf)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [
|
||||
"src/plba/__init__.py"
|
||||
],
|
||||
"symbol_candidates": [],
|
||||
"layers": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- llm: expected answer to exclude 'из различных подпакетов'
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
# 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: 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\n\nВ этом файле содержится определение класса `RuntimeManager`. В примере приведено начало класса с инициализатором (`__init__`) и некоторыми атрибутами и параметрами, такими как `ACTION_TIMEOUT_SECONDS`, `ACTION_POLL_INTERVAL_SECONDS`, а также параметрами конфигурации и сервисов, которые могут передаваться при создании экземпляра класса.",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [
|
||||
"src/app_runtime/core/runtime.py"
|
||||
],
|
||||
"symbol_candidates": [],
|
||||
"layers": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
# 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: 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": "1. HttpControlAppFactory.create(health_provider, action_provider)\n - Создает экземпляр FastAPI приложения.\n - Добавляет middleware для логирования времени ответа.\n - Определяет маршрут `/health`.\n \n2. HttpControlAppFactory.create().get(\"/health\")\n - Вызывает health_provider, чтобы получить состояние здоровья.\n - Устанавливает статус-код ответа:\n - 200, если состояние \"ok\".\n - 503, если состояние отличное от \"ok\".\n - Возвращает JSON с состоянием здоровья.\n\nЦепочка неполная, так как отсутствует детальная информация о вызове 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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": "1. Запускается `RuntimeManager` через инициализацию переменной `RuntimeManager`.\n2. Инициализация `RuntimeManager` вызывает метод `RuntimeManager.__init__`.\n3. В методе `RuntimeManager.__init__` происходит регистрация основных сервисов с помощью метода `_register_core_services`.\n4. Метод `_register_core_services` вызывает регистрацию базовых сервисов, таких как конфигурация (`configuration`), сервисы (`services`) и другие компоненты системы.\n5. Далее выполняется метод `start`, который инициирует запуск различных каналов управления и контрольных служб.\n6. Вызывается метод `ControlPlaneService.start`, передавая экземпляр `RuntimeManager`.\n7. Внутри `ControlPlaneService.start` регистрируется канал управления и запускается асинхронный процесс старта с использованием `asyncio.run`.\n8. Контрольный канал (`ControlChannel`) начинает свою работу путем вызова метода `start` и регистрации действий (`ControlActionSet`).\n9. Затем управление передается в HTTP-контроллер, где создается экземпляр `HttpControlChannel`, запускающий веб-сервер с помощью библиотеки Uvicorn.\n10. Веб-сервер принимает запросы на стандартные действия, такие как проверка состояния здоровья (`health`), выполнение стартовых и остановочных операций, получение статусов активности.\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
|
||||
@@ -0,0 +1,86 @@
|
||||
# pipeline_setup_v3 summary
|
||||
|
||||
Passed: 14/18
|
||||
|
||||
| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass |
|
||||
|------|------|------|-------|-------------------|------------|------|
|
||||
| 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-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-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-explain-nonexistent-symbol | full_chain | Объясни класс RuntimeFactoryManager | 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-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-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:6, C3_ENTRYPOINTS:3 | ✗ |
|
||||
| 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-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-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-open-file-nonexistent | full_chain | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | — | ✗ |
|
||||
| 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-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-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-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 | ✓ |
|
||||
|
||||
## Failures
|
||||
- **plba-v2-explain-nonexistent-symbol**: answer_mode: expected degraded, got answered; retrieval: expected empty rag, got 33 rows; llm: expected answer to contain 'не найдена'
|
||||
- **plba-v2-find-entrypoints-health-endpoint**: llm: expected answer to contain 'GET /health'
|
||||
- **plba-v2-open-file-nonexistent**: answer_mode: expected degraded, got not_found; llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'
|
||||
- **plba-v2-open-file-public-api**: llm: expected answer to exclude 'из различных подпакетов'
|
||||
|
||||
## LLM Answers
|
||||
- **plba-v2-architecture-control-plane**
|
||||
Query: Какие компоненты участвуют в ControlPlaneService?
|
||||
> Подтвержденные связи и роли компонентов в контексте ControlPlaneService: \#\#\# Компоненты и их роли 1. \*\*ControlPlaneService\*\* \- Роль: pipeline\_stage \- Описание: Инициализирует каналы управления и управляет ими. 2. \*\*ControlChannel\*\* \- Роль: model \- Описание: Абстрактный класс для каналов управления с методами старта и остановки. 3. \*\*ControlActionSet\*\* \- Роль: model \- Описание: Представляет набор действий контроля. 4. \*\*UvicornThreadRunner\*\* \- Роль: pipeline\_stage \- Описание: Управляет uvicorn сервером и участвует в потоках данных. 5. \*\*HttpControlChannel\*\* \- Роль: pipeline\_stage \- Описание: Канал управления HTTP\-соединениями, участвующий в потоках данных. 6. \*\*HttpControlAppFactory\*\* \- Роль: factory \- Описание: Фабрика для создания fastAPI приложений. 7. \*\*WorkflowPersistence\*\* \- Роль: pipeline\_stage \- Описание: Хранит информацию о процессах и взаимодействует с ними.…
|
||||
- **plba-v2-architecture-runtime-manager**
|
||||
Query: Какие компоненты участвуют в RuntimeManager?
|
||||
> \#\#\# Компоненты, участвующие в RuntimeManager \#\#\#\# Подтвержденные связи 1. \*\*RuntimeManager\*\* \- Role: Pipeline Stage \- Responsibilities: \- Manager responsibilities \- Orchestration of role\-like calls \- State attribute reading/writing \- Participation in dataflow slices 2. \*\*ControlPlaneService\*\* \- Role: Pipeline Stage \- Responsibilities: \- Service responsibilities \- State attribute reading/writing \- Participation in dataflow slices 3. \*\*UvicornThreadRunner\*\* \- Role: Pipeline Stage \- Responsibilities: \- State attribute reading/writing \- Participation in dataflow slices 4. \*\*HttpControlChannel\*\* \- Role: Pipeline Stage \- Responsibilities: \- State attribute reading/writing \- Participation in dataflow slices 5. \*\*WorkflowPersistence\*\* \- Role: Pipeline Stage \- Responsibilities: \- Orchestration of role\-like calls \- State attribute reading/writing \- Participation in dataflow sl…
|
||||
- **plba-v2-explain-create-runtime**
|
||||
Query: Что делает функция create_runtime?
|
||||
> Функция \`create\_runtime\` инициализирует и настраивает менеджер выполнения приложения. \*\*Ключевые шаги:\*\* 1. Инициализация менеджера выполнения \(\`RuntimeManager\(\)\`\). 2. Добавление конфигурационного файла, если указан путь \(\`add\_config\_file\`\). 3. Регистрация HTTP\-канала управления, если включен режим управления \(\`register\_channel\`\). 4. Регистрация модуля приложения в менеджере выполнения \(\`register\_module\`\). \*\*Опорные файлы:\*\* \- \`src/plba/bootstrap.py:8\-29\` Этот процесс позволяет настроить и запустить приложение с учетом заданных конфигураций и режимов управления.
|
||||
- **plba-v2-explain-local-http-channel**
|
||||
Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?
|
||||
> Класс \`HttpControlChannel\` предназначен для управления HTTP каналом контроля в приложении. \*\*Ключевые шаги его реализации:\*\* 1. Инициализация \(\`\_\_init\_\_\`\) – принимает параметры хоста, порта и тайм\-аута, создаёт внутренние объекты управления и инициализирует состояние канала. 2. Запуск \(\`start\`\) – запускает сервер с заданными действиями контроля, создавая приложение и вызывая runner для запуска сервера. 3. Остановка \(\`stop\`\) – останавливает запущенный сервер. 4. Свойство \`port\` – возвращает порт, используемый сервером. 5. Метод \`\_health\_response\` – генерирует ответ о состоянии здоровья системы \(здоров или нет\). Опорные файлы: \- \`src/app\_runtime/control/http\_channel.py:12\-57\` \(определение класса и методов\) \- \`src/app\_runtime/control/http\_channel.py:13\-17\` \(инициализация\) \- \`src/app\_runtime/control/http\_channel.py:19\-22\` \(запуск\)
|
||||
- **plba-v2-explain-nonexistent-symbol**
|
||||
Query: Объясни класс RuntimeFactoryManager
|
||||
> Класс \`RuntimeFactoryManager\` не указан напрямую в предоставленном коде. Однако, судя по контексту и взаимосвязям между классами: \*\*Назначение класса:\*\* \- Управление фабрикой для создания экземпляров классов, связанных с управлением рабочим состоянием приложения. \*\*Ключевые шаги:\*\* 1. Инициализация фабрики. 2. Создание экземпляра соответствующего класса управления каналом \(\`ControlChannel\`\) или другого необходимого класса. 3. Регистрация созданных каналов в сервисе управления каналами. \*\*Опорные файлы:\*\* \- \`src/app\_runtime/control/base.py\`: Объявление абстрактного базового класса \`ControlChannel\`. \- \`src/app\_runtime/control/service.py\`: Реализация сервиса управления каналами, который регистрирует созданные каналы. \- \`src/app\_runtime/control/http\_channel.py\`: Определение канала HTTP, используемого для взаимодействия через HTTP\-протокол. Обратите внимание, что прямое о…
|
||||
- **plba-v2-explain-runtime-manager**
|
||||
Query: Объясни как работает класс RuntimeManager
|
||||
> \*\*Класс \`RuntimeManager\`\*\* отвечает за управление жизненным циклом приложения и координацию различных компонентов системы. \#\#\# Ключевые шаги работы класса: 1. \*\*Инициализация конфигурации:\*\* Класс инициализирует начальные настройки приложения, включая загрузку конфигурационных файлов. 2. \*\*Регистрация каналов управления:\*\* Метод \`register\_channel\` позволяет зарегистрировать каналы управления, которые будут использоваться для взаимодействия с различными компонентами системы. 3. \*\*Запуск и остановка системы:\*\* Методы \`start\` и \`stop\` инициируют запуск и остановку всех зарегистрированных каналов управления, обеспечивая корректное завершение работы системы. 4. \*\*Сохранение состояния:\*\* Метод \`snapshot\` создает снимок текущего состояния системы, который может быть использован для восстановления или анализа состояния в будущем. \#\#\# Опорные файлы: \- \`src/app\_runtime/core/ru…
|
||||
- **plba-v2-explain-trace-service**
|
||||
Query: Объясни как работает класс TraceService
|
||||
> \*\*Класс \`TraceService\`\*\* предназначен для управления контекстом трассировки в приложении. Его основные функции включают создание нового контекста трассировки, получение текущего идентификатора трассировки и закрытие контекста. \*\*Ключевые шаги работы класса:\*\* 1. \*\*Инициализация:\*\* При создании экземпляра \`TraceService\` задаются транспорт и хранилище контекста трассировки \(по умолчанию используются заглушки\). 2. \*\*Создание контекста:\*\* Метод \`create\_context\` создает новый контекст трассировки с заданными параметрами \(идентификатор, родительский идентификатор, тип и атрибуты\). Контекст сохраняется в хранилище. 3. \*\*Получение текущего идентификатора:\*\* Метод \`current\_trace\_id\` возвращает текущий идентификатор трассировки. 4. \*\*Открытие контекста:\*\* Метод \`open\_context\` открывает новый контекст трассировки. 5. \*\*Закрытие контекста:\*\* Метод \`close\_context\` завершает текущ…
|
||||
- **plba-v2-find-entrypoints-control-plane**
|
||||
Query: Найди точки входа HTTP control plane
|
||||
> confirmed\_entrypoints: \- src/app\_runtime/control/http\_app.py:app.post \(line range: 38\-42\) \- src/app\_runtime/control/http\_app.py:app.get \(line range: 31\-34\) \- src/app\_runtime/control/http\_app.py:app.get \(line range: 38\-42\)
|
||||
- **plba-v2-find-entrypoints-health-endpoint**
|
||||
Query: Где health endpoint?
|
||||
> health endpoint: \- src/app\_runtime/control/http\_app.py:38\-42 \(app.post\) \- src/app\_runtime/control/http\_app.py:31\-34 \(app.get\)
|
||||
- **plba-v2-find-tests-create-runtime**
|
||||
Query: Где тесты для create_runtime?
|
||||
> \- tests/test\_runtime.py:342\-405 \(test\_public\_plba\_package\_exports\_runtime\_builder\_and\_worker\_contract\)
|
||||
- **plba-v2-find-tests-runtime-manager**
|
||||
Query: Где тесты для RuntimeManager?
|
||||
> \- tests/test\_runtime.py:12\-12 \- tests/test\_business\_control\_actions.py:14\-14
|
||||
- **plba-v2-find-tests-trace-service**
|
||||
Query: Где тесты для TraceService?
|
||||
> tests/test\_runtime.py:test\_trace\_service\_allows\_messages\_without\_status tests/test\_runtime.py:test\_trace\_service\_writes\_contexts\_and\_messages tests/test\_runtime.py:test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels
|
||||
- **plba-v2-find-tests-workflow-runtime-factory-negative**
|
||||
Query: Где тесты для WorkflowRuntimeFactory?
|
||||
> Insufficient evidence for a confident answer. No test candidates found.
|
||||
- **plba-v2-open-file-nonexistent**
|
||||
Query: Открой файл src/app_runtime/core/missing_runtime.py
|
||||
> Файл \`src/app\_runtime/core/missing\_runtime.py\` не найден.
|
||||
- **plba-v2-open-file-public-api**
|
||||
Query: Открой файл src/plba/__init__.py
|
||||
> Путь к файлу: src/plba/\_\_init\_\_.py В этом файле находятся импортированные модули и классы из различных подпакетов библиотеки plba. Файл служит точкой входа для пользователей, предоставляя доступ к основным функциям и классам библиотеки. В частности, здесь импортируются: \- Функции и классы для создания runtime \(create\_runtime\) \- Конфигурационные файлы и провайдеры \(ConfigFileLoader, FileConfigProvider\) \- Контрольные каналы и службы \(ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\) \- Определения контрактов \(ApplicationModule, ConfigProvider, HealthContributor и др.\) \- Менеджеры конфигурации и выполнения \(ConfigurationManager, RuntimeManager, ServiceContainer\) \- Службы мониторинга здоровья \(HealthRegistry\) \- Управление логированием \(LogManager\) \- Очереди задач \(InMemoryTaskQueue\) \- Транспортировка трассировки \(MySqlTraceTransport, NoOpTraceTran…
|
||||
- **plba-v2-open-file-runtime**
|
||||
Query: Открой файл src/app_runtime/core/runtime.py
|
||||
> Путь: src/app\_runtime/core/runtime.py В этом файле содержится определение класса \`RuntimeManager\`. В примере приведено начало класса с инициализатором \(\`\_\_init\_\_\`\) и некоторыми атрибутами и параметрами, такими как \`ACTION\_TIMEOUT\_SECONDS\`, \`ACTION\_POLL\_INTERVAL\_SECONDS\`, а также параметрами конфигурации и сервисов, которые могут передаваться при создании экземпляра класса.
|
||||
- **plba-v2-trace-flow-health-endpoint**
|
||||
Query: Покажи как проходит запрос /health в HttpControlAppFactory
|
||||
> 1. HttpControlAppFactory.create\(health\_provider, action\_provider\) \- Создает экземпляр FastAPI приложения. \- Добавляет middleware для логирования времени ответа. \- Определяет маршрут \`/health\`. 2. HttpControlAppFactory.create\(\).get\("/health"\) \- Вызывает health\_provider, чтобы получить состояние здоровья. \- Устанавливает статус\-код ответа: \- 200, если состояние "ok". \- 503, если состояние отличное от "ok". \- Возвращает JSON с состоянием здоровья. Цепочка неполная, так как отсутствует детальная информация о вызове health\_provider и его реализации.
|
||||
- **plba-v2-trace-flow-runtime-start**
|
||||
Query: Покажи поток выполнения при запуске RuntimeManager
|
||||
> 1. Запускается \`RuntimeManager\` через инициализацию переменной \`RuntimeManager\`. 2. Инициализация \`RuntimeManager\` вызывает метод \`RuntimeManager.\_\_init\_\_\`. 3. В методе \`RuntimeManager.\_\_init\_\_\` происходит регистрация основных сервисов с помощью метода \`\_register\_core\_services\`. 4. Метод \`\_register\_core\_services\` вызывает регистрацию базовых сервисов, таких как конфигурация \(\`configuration\`\), сервисы \(\`services\`\) и другие компоненты системы. 5. Далее выполняется метод \`start\`, который инициирует запуск различных каналов управления и контрольных служб. 6. Вызывается метод \`ControlPlaneService.start\`, передавая экземпляр \`RuntimeManager\`. 7. Внутри \`ControlPlaneService.start\` регистрируется канал управления и запускается асинхронный процесс старта с использованием \`asyncio.run\`. 8. Контрольный канал \(\`ControlChannel\`\) начинает свою работу путем вызова метода \`start\` и…
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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": "### Подтвержденные Связи\n\n1. **ControlPlaneService**:\n - Вызывает методы инициализации (`_channels`, `_start_async`, `register_channel`, `start`, `stop`, `_stop_async`) [evidence: 16-20].\n \n2. **ControlPlaneService** взаимодействует с другими компонентами через методы регистрации каналов и запуска:\n - Регистрация канала (`register_channel`) использует атрибут `_channels` для хранения списка зарегистрированных каналов [evidence: 22].\n - Запуск сервиса использует метод `start`, который также обращается к атрибуту `_channels` [evidence: 23].\n\n### Роли Компонентов\n\n1. **ControlPlaneService**:\n - Pipeline stage: отвечает за чтение и запись состояния атрибутов, участвует в данных срезах (dataflow slices).\n\n2. **ControlChannel**:\n - Model: выполняет функции модели управления каналами, включая запуск и остановку.\n\n3. **ControlActionSet**:\n - Default model role: обеспечивает стандартные действия для контроля.\n\n4. **UvicornThreadRunner**, **HttpControlChannel**, **HttpControlAppFactory**, **WorkflowPersistence**, **InMemoryTaskQueue**, **ConfigFileLoader**, **TraceContextStore**, **WorkerSupervisor**, **WorkflowEngine**:\n - Pipeline stages: отвечают за выполнение различных задач, связанных с обработкой данных и состоянием приложения.\n\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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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": "### Подтвержденные Связи\n\n1. **RuntimeManager**:\n - Является ключевым компонентом управления жизненным циклом приложения.\n - Инициализирует и управляет другими компонентами системы через метод `__init__`.\n \n2. **ControlPlaneService**:\n - Управляет каналами контроля.\n - Вызывается из метода инициализации `RuntimeManager` для регистрации каналов.\n\n3. **ControlChannel**:\n - Абстрактный класс для реализации конкретных каналов контроля.\n - Реализует методы `start` и `stop`, которые вызываются сервисами и менеджерами.\n\n4. **ConfigFileLoader**:\n - Загружает конфигурационные файлы и передает их в runtime-менеджер.\n\n5. **WorkflowPersistence**:\n - Обеспечивает сохранение информации о workflows.\n\n6. **InMemoryTaskQueue**:\n - Используется для хранения задач внутри памяти.\n\n7. **TraceContextStore**:\n - Хранит контекст трассировки.\n\n8. **WorkerSupervisor**:\n - Наблюдает за рабочими процессами и управляет ими.\n\n### Роли Компонентов\n\n1. **RuntimeManager**:\n - Координирует работу всех других компонентов.\n - Читает и записывает состояние атрибутов.\n - Участвует в управлении данными потока.\n\n2. **ControlPlaneService**:\n - Регистрирует каналы контроля.\n - Начинает и останавливает службы контроля.\n\n3. **ControlChannel**:\n - Осуществляет управление каналами взаимодействия между приложением и внешними системами.\n\n4. **ConfigFileLoader**:\n - Чтение конфигурации из файлов.\n\n5. **WorkflowPersistence**:\n - Сохраняет информацию о workflows.\n\n6. **InMemoryTaskQueue**:\n - Хранение данных задачи во временной памяти.\n\n7. **TraceContextStore**:\n - Управление контекстом трассировки.\n\n8. **WorkerSupervisor**:\n - Контроль рабочих процессов.\n\n### Ограничения Контекста\n\n1. **Dataflow Slices**:\n - Все перечисленные компоненты активно участвуют в обработке данных потоков.\n\n2. **State Attributes**:\n - Большинство компонентов читают или записывают состояние атрибутов системы.\n\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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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` инициализирует и настраивает менеджер выполнения приложения.\n\n**Ключевые шаги:**\n1. Создает экземпляр менеджера выполнения (`RuntimeManager`).\n2. При наличии указанного пути к конфигурационному файлу добавляет его в менеджер.\n3. Если включена опция HTTP-контроля, регистрирует канал управления с указанными параметрами хоста, порта и тайм-аута.\n4. Регистрирует указанный модуль приложения в менеджере.\n5. Возвращает созданный менеджер выполнения.\n\n**Опорные файлы:**\n- `src/plba/bootstrap.py:8-29`",
|
||||
"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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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` в файле `src/app_runtime/control/http_channel.py` реализует механизм управления HTTP-каналом для взаимодействия с внешними сервисами или компонентами.\n\n**Ключевые шаги его реализации:**\n1. Инициализация класса:\n - При создании экземпляра устанавливается таймаут (`_timeout`), запускается сервер через объект `UvicornThreadRunner`, создается фабрика приложений `HttpControlAppFactory`.\n \n2. Запуск канала:\n - Метод `start` инициализирует набор действий (`actions`) и создает приложение для работы с ними. Затем запускает сервер через ранее созданный объект `UvicornThreadRunner`.\n \n3. Остановка канала:\n - Метод `stop` останавливает запущенный сервер.\n\nОпорные файлы:\n- `src/app_runtime/control/http_channel.py`: определение и реализация класса `HttpControlChannel`.",
|
||||
"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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
# 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: agent_runtime
|
||||
- mode: full_chain
|
||||
- passed: False
|
||||
|
||||
## Query
|
||||
Объясни класс RuntimeFactoryManager
|
||||
|
||||
## Actual
|
||||
{
|
||||
"intent": "CODE_QA",
|
||||
"sub_intent": "EXPLAIN",
|
||||
"graph_id": "CodeQAGraph",
|
||||
"conversation_mode": "START",
|
||||
"rag_count": 33,
|
||||
"llm_answer": "Класс `RuntimeFactoryManager` не найден в предоставленном коде или контекстной информации.\n\nКлючевые шаги и опорные файлы:\n1. Код и контекста относятся к управлению каналами управления («control channels») в приложении.\n2. Основные классы включают `ControlChannel`, `ControlActionSet`, и связанные с ними каналы и сервисы.\n3. Основной файл для рассмотрения — `base.py`.\n4. Ключевые обязанности и интерфейсы описаны через абстрактные методы (`start`, `stop`) в классе `ControlChannel`. \n\nПоскольку конкретный класс `RuntimeFactoryManager` отсутствует в данном контексте, невозможно предоставить его объяснение.",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"RuntimeFactoryManager"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C0_SOURCE_CHUNKS",
|
||||
"C4_SEMANTIC_ROLES",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C3_ENTRYPOINTS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- answer_mode: expected degraded, got answered
|
||||
- retrieval: expected empty rag, got 33 rows
|
||||
- llm: expected answer to contain 'не найдена'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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` играет ключевую роль в управлении выполнением приложений и координации различных компонентов системы. Его основная функция заключается в оркестрации действий, связанных с жизненным циклом приложения, включая инициализацию, запуск и остановку сервисов и модулей.\n\n**Ключевые шаги работы класса:**\n1. Инициализация конфигурации и состояния (`__init__`).\n2. Добавление конфигурационных файлов и настроек (`add_config_file`).\n3. Управление состоянием выполнения через чтение и запись атрибутов состояния (`configuration`, `_state`).\n4. Оркестровка вызова методов запуска и остановки для различных компонентов (`start`, `stop`).\n5. Участие в обработке данных потока и управлении потоками задач (`participates in dataflow slices`).\n\n**Опорные файлы:**\n- `src/app_runtime/core/runtime.py:18-179`\n- `src/app_runtime/control/service.py:12-52`\n- `src/app_runtime/control/base.py:21-28`\n- `src/app_runtime/control/base.py:14-18`",
|
||||
"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
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
|
||||
# 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: 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` является основным компонентом системы отслеживания трассировок в приложении. Его основная функция заключается в управлении контекстом трассировки и записи событий в журнал.\n\n**Ключевые шаги работы класса:**\n1. Инициализация с передачей транспорта (`transport`) и хранилища контекста (`store`), которые могут быть опциональными.\n2. Создание нового контекста трассировки через метод `create_context`, который генерирует уникальный идентификатор трассы и сохраняет запись о контексте в хранилище.\n3. Управление текущим контекстом трассировки через методы:\n - `current_trace_id`: возвращает текущий идентификатор трассировки.\n - `open_context`: открывает новый контекст трассировки.\n - `close_context`: закрывает текущий контекст трассировки.\n \n**Опорные файлы:**\n- `src/app_runtime/tracing/service.py:39-166`\n- `src/app_runtime/tracing/service.py:66-78`\n- `src/app_runtime/tracing/service.py:45-63`",
|
||||
"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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
# 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: 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": "Confirmed Entrypoints:\n1. src/app_runtime/control/http_app.py:app.post (lines 38-42)\n2. src/app_runtime/control/http_app.py:app.get (lines 31-34)\n3. src/app_runtime/control/http_app.py:app.get (lines 38-42)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"HTTP",
|
||||
"control",
|
||||
"plane"
|
||||
],
|
||||
"layers": [
|
||||
"C3_ENTRYPOINTS",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: agent_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": "health endpoint: \n- src/app_runtime/control/http_app.py:38-42 (app.post)\n- src/app_runtime/control/http_app.py:31-34 (app.get)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"health",
|
||||
"endpoint"
|
||||
],
|
||||
"layers": [
|
||||
"C3_ENTRYPOINTS",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- llm: expected answer to contain 'GET /health'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "- tests/test_runtime.py:342-405",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"create_runtime"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "- tests/test_runtime.py:12-12\n- tests/test_business_control_actions.py:14-14",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"RuntimeManager"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
# 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: 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": "- tests/test_runtime.py:test_trace_service_allows_messages_without_status (line range: 279-293)\n- tests/test_runtime.py:test_trace_service_writes_contexts_and_messages (line range: 246-259)\n- tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels (line range: 262-276)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [],
|
||||
"symbol_candidates": [
|
||||
"TraceService"
|
||||
],
|
||||
"layers": [
|
||||
"C1_SYMBOL_CATALOG",
|
||||
"C2_DEPENDENCY_GRAPH",
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
# 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: 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"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"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": "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": false,
|
||||
"mismatches": [
|
||||
"answer_mode: expected degraded, got not_found",
|
||||
"llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'"
|
||||
],
|
||||
"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": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
"diagnostics": {
|
||||
"intent_correct": null,
|
||||
"target_found": false,
|
||||
"layers_used": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
],
|
||||
"retrieval_sufficient": false,
|
||||
"answer_mode": "insufficient",
|
||||
"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
|
||||
},
|
||||
"failure_reasons": [
|
||||
"path_scope_empty",
|
||||
"layer_c0_empty"
|
||||
],
|
||||
"timings_ms": {}
|
||||
},
|
||||
"rag_rows": [],
|
||||
"validation": {
|
||||
"passed": true,
|
||||
"action": "return",
|
||||
"reasons": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# 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: agent_runtime
|
||||
- mode: full_chain
|
||||
- passed: False
|
||||
|
||||
## 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"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- answer_mode: expected degraded, got not_found
|
||||
- llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'
|
||||
@@ -0,0 +1,417 @@
|
||||
{
|
||||
"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": "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. В частности, здесь можно найти:\n- Импорты для создания runtime с помощью `create_runtime`\n- Классы и интерфейсы конфигурации (`ConfigFileLoader`, `FileConfigProvider`)\n- Контроллеры и каналы управления (`ControlActionSet`, `ControlChannel`, `HttpControlChannel`)\n- Определения контрактов (`ApplicationModule`, `Worker`, etc.)\n- Менеджеры конфигурации и выполнения (`ConfigurationManager`, `RuntimeManager`, `ServiceContainer`)\n- Регистраторы здоровья и службы логирования\n- Обработчики очередей задач и транспортные средства трассировки (`InMemoryTaskQueue`, `MySqlTraceTransport`, `NoOpTraceTransport`)\n- Определение рабочего потока и контекста (`StepResult`, `WorkflowContext`, `WorkflowDefinition`)",
|
||||
"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": 21
|
||||
}
|
||||
}
|
||||
},
|
||||
"diagnostics": {
|
||||
"intent_correct": null,
|
||||
"target_found": true,
|
||||
"layers_used": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
],
|
||||
"retrieval_sufficient": true,
|
||||
"answer_mode": "normal",
|
||||
"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
|
||||
},
|
||||
"failure_reasons": [],
|
||||
"timings_ms": {}
|
||||
},
|
||||
"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": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
# 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: 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. В частности, здесь можно найти:\n- Импорты для создания runtime с помощью `create_runtime`\n- Классы и интерфейсы конфигурации (`ConfigFileLoader`, `FileConfigProvider`)\n- Контроллеры и каналы управления (`ControlActionSet`, `ControlChannel`, `HttpControlChannel`)\n- Определения контрактов (`ApplicationModule`, `Worker`, etc.)\n- Менеджеры конфигурации и выполнения (`ConfigurationManager`, `RuntimeManager`, `ServiceContainer`)\n- Регистраторы здоровья и службы логирования\n- Обработчики очередей задач и транспортные средства трассировки (`InMemoryTaskQueue`, `MySqlTraceTransport`, `NoOpTraceTransport`)\n- Определение рабочего потока и контекста (`StepResult`, `WorkflowContext`, `WorkflowDefinition`)",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [
|
||||
"src/plba/__init__.py"
|
||||
],
|
||||
"symbol_candidates": [],
|
||||
"layers": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
# 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: 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\n\nВ этом файле содержится определение класса `RuntimeManager`. В классе инициализируются различные компоненты системы, такие как конфигурация, службы, трассировка, здоровье, журналы, рабочие процессы и контрольная плоскость. Класс предназначен для управления выполнением действий в системе с заданными тайм-аутами и интервалами опроса.",
|
||||
"answer_mode": "answered",
|
||||
"path_scope": [
|
||||
"src/app_runtime/core/runtime.py"
|
||||
],
|
||||
"symbol_candidates": [],
|
||||
"layers": [
|
||||
"C0_SOURCE_CHUNKS"
|
||||
]
|
||||
}
|
||||
|
||||
## Mismatches
|
||||
- none
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
# 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: 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": "1. HttpControlAppFactory.create(health_provider, action_provider)\n - Создает FastAPI приложение.\n - Добавляет middleware для логирования времени ответа.\n - Обрабатывает GET запрос к \"/health\".\n\n2. HttpControlAppFactory.create.health()\n - Вызывается при обработке запроса \"/health\".\n - Возвращает Awaitable объект типа HealthPayload.\n\n3. HttpControlAppFactory.create.action_provider()\n - Определяет поведение при запросе действий.\n\nПолный поток вызова от обработки запроса \"/health\" до получения 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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": "1. Запускается `RuntimeManager` через импорт в `bootstrap.py` (`src/plba/bootstrap.py:4`).\n2. Далее, в `control/service.py`, происходит повторный импорт и переопределение переменной `RuntimeManager` как `app_runtime.core.runtime.RuntimeManager` (`src/app_runtime/control/service.py:9`).\n3. В файле `core/runtime.py` начинается определение класса `RuntimeManager`. Этот класс управляет состоянием приложения и участвует в управлении жизненным циклом различных сервисов и модулей (`src/app_runtime/core/runtime.py:18-179`).\n4. Из `__init__.py` модуля `plba` (`src/plba/__init__.py:16`) импортируется другой экземпляр `RuntimeManager`.\n5. Затем идет обращение к инициализации объекта `ControlPlaneService` в модуле `control/service.py` (`src/app_runtime/control/service.py:12-52`), который регистрирует каналы управления.\n6. Контроллер канала управления определяется в `base.py` файла `control` и имеет методы для запуска и остановки каналов (`src/app_runtime/control/base.py:21-28`).\n7. В `control/http_channel.py` создается объект `HttpControlChannel`, управляющий HTTP-запросами с использованием библиотеки uvicorn (`src/app_runtime/control/http_channel.py:12-57`).\n8. Модуль `control/http_app.py` создает фабрику приложений для обработки HTTP-запросов, связанных с управлением состоянием системы (`src/app_runtime/control/http_app.py:15-53`).\n9. Инициализация конфигурации и параметров происходит в методах `_register_core_services` и `_start_async` внутри класса `RuntimeManager` (`src/app_runtime/core/runtime.py:32-127`).\n\nПолный путь вызова:\n\n1. `src/plba/bootstrap.py`\n2. `src/app_runtime/control/service.py`\n3. `src/app_runtime/core/runtime.py`\n4. `src/plba/__init__.py`\n5. `src/app_runtime/control/service.py`\n6. `src/app_runtime/control/base.py`\n7. `src/app_runtime/control/http_channel.py`\n8. `src/app_runtime/control/http_app.py`\n9. `src/app_runtime/core/runtime.py`",
|
||||
"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
|
||||
@@ -0,0 +1,85 @@
|
||||
# pipeline_setup_v3 summary
|
||||
|
||||
Passed: 15/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:6, 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 | 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-open-file-nonexistent | full_chain | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | — | ✗ |
|
||||
|
||||
## Failures
|
||||
- **plba-v2-find-entrypoints-health-endpoint**: llm: expected answer to contain 'GET /health'
|
||||
- **plba-v2-explain-nonexistent-symbol**: answer_mode: expected degraded, got answered; retrieval: expected empty rag, got 33 rows; llm: expected answer to contain 'не найдена'
|
||||
- **plba-v2-open-file-nonexistent**: answer_mode: expected degraded, got not_found; llm: expected answer to contain 'Файл src/app_runtime/core/missing_runtime.py не найден.'
|
||||
|
||||
## 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. В частности, здесь можно найти: \- Импорты для создания runtime с помощью \`create\_runtime\` \- Классы и интерфейсы конфигурации \(\`ConfigFileLoader\`, \`FileConfigProvider\`\) \- Контроллеры и каналы управления \(\`ControlActionSet\`, \`ControlChannel\`, \`HttpControlChannel\`\) \- Определения контрактов \(\`ApplicationModule\`, \`Worker\`, etc.\) \- Менеджеры конфигурации и выполнения \(\`ConfigurationManager\`, \`RuntimeManager\`, \`ServiceContainer\`\) \- Регистраторы здоровья и службы логирования \- Обработчики очередей задач и транспортные средства трассировки \(\`InMemoryTaskQueue\`, \`MySqlTraceTransport\`, \`NoOpTraceTransport\`\) \- Определение рабочего потока и контекста \(\`StepResult\`, \`WorkflowContext\`, \`WorkflowDefinition\`\)
|
||||
- **plba-v2-explain-runtime-manager**
|
||||
Query: Объясни как работает класс RuntimeManager
|
||||
> Класс \`RuntimeManager\` играет ключевую роль в управлении выполнением приложений и координации различных компонентов системы. Его основная функция заключается в оркестрации действий, связанных с жизненным циклом приложения, включая инициализацию, запуск и остановку сервисов и модулей. \*\*Ключевые шаги работы класса:\*\* 1. Инициализация конфигурации и состояния \(\`\_\_init\_\_\`\). 2. Добавление конфигурационных файлов и настроек \(\`add\_config\_file\`\). 3. Управление состоянием выполнения через чтение и запись атрибутов состояния \(\`configuration\`, \`\_state\`\). 4. Оркестровка вызова методов запуска и остановки для различных компонентов \(\`start\`, \`stop\`\). 5. Участие в обработке данных потока и управлении потоками задач \(\`participates in dataflow slices\`\). \*\*Опорные файлы:\*\* \- \`src/app\_runtime/core/runtime.py:18\-179\` \- \`src/app\_runtime/control/service.py:12\-52\` \- \`src/app\_runtime/contr…
|
||||
- **plba-v2-explain-trace-service**
|
||||
Query: Объясни как работает класс TraceService
|
||||
> Класс \`TraceService\` является основным компонентом системы отслеживания трассировок в приложении. Его основная функция заключается в управлении контекстом трассировки и записи событий в журнал. \*\*Ключевые шаги работы класса:\*\* 1. Инициализация с передачей транспорта \(\`transport\`\) и хранилища контекста \(\`store\`\), которые могут быть опциональными. 2. Создание нового контекста трассировки через метод \`create\_context\`, который генерирует уникальный идентификатор трассы и сохраняет запись о контексте в хранилище. 3. Управление текущим контекстом трассировки через методы: \- \`current\_trace\_id\`: возвращает текущий идентификатор трассировки. \- \`open\_context\`: открывает новый контекст трассировки. \- \`close\_context\`: закрывает текущий контекст трассировки. \*\*Опорные файлы:\*\* \- \`src/app\_runtime/tracing/service.py:39\-166\` \- \`src/app\_runtime/tracing/service.py:66\-78\` \- \`src/app\_ru…
|
||||
- **plba-v2-explain-create-runtime**
|
||||
Query: Что делает функция create_runtime?
|
||||
> Функция \`create\_runtime\` инициализирует и настраивает менеджер выполнения приложения. \*\*Ключевые шаги:\*\* 1. Создает экземпляр менеджера выполнения \(\`RuntimeManager\`\). 2. При наличии указанного пути к конфигурационному файлу добавляет его в менеджер. 3. Если включена опция HTTP\-контроля, регистрирует канал управления с указанными параметрами хоста, порта и тайм\-аута. 4. Регистрирует указанный модуль приложения в менеджере. 5. Возвращает созданный менеджер выполнения. \*\*Опорные файлы:\*\* \- \`src/plba/bootstrap.py:8\-29\`
|
||||
- **plba-v2-explain-local-http-channel**
|
||||
Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?
|
||||
> Класс \`HttpControlChannel\` в файле \`src/app\_runtime/control/http\_channel.py\` реализует механизм управления HTTP\-каналом для взаимодействия с внешними сервисами или компонентами. \*\*Ключевые шаги его реализации:\*\* 1. Инициализация класса: \- При создании экземпляра устанавливается таймаут \(\`\_timeout\`\), запускается сервер через объект \`UvicornThreadRunner\`, создается фабрика приложений \`HttpControlAppFactory\`. 2. Запуск канала: \- Метод \`start\` инициализирует набор действий \(\`actions\`\) и создает приложение для работы с ними. Затем запускает сервер через ранее созданный объект \`UvicornThreadRunner\`. 3. Остановка канала: \- Метод \`stop\` останавливает запущенный сервер. Опорные файлы: \- \`src/app\_runtime/control/http\_channel.py\`: определение и реализация класса \`HttpControlChannel\`.
|
||||
- **plba-v2-find-tests-runtime-manager**
|
||||
Query: Где тесты для RuntimeManager?
|
||||
> \- tests/test\_runtime.py:12\-12 \- tests/test\_business\_control\_actions.py:14\-14
|
||||
- **plba-v2-find-tests-trace-service**
|
||||
Query: Где тесты для TraceService?
|
||||
> \- tests/test\_runtime.py:test\_trace\_service\_allows\_messages\_without\_status \(line range: 279\-293\) \- tests/test\_runtime.py:test\_trace\_service\_writes\_contexts\_and\_messages \(line range: 246\-259\) \- tests/test\_runtime.py:test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels \(line range: 262\-276\)
|
||||
- **plba-v2-find-tests-create-runtime**
|
||||
Query: Где тесты для create_runtime?
|
||||
> \- tests/test\_runtime.py:342\-405
|
||||
- **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
|
||||
> Confirmed Entrypoints: 1. src/app\_runtime/control/http\_app.py:app.post \(lines 38\-42\) 2. src/app\_runtime/control/http\_app.py:app.get \(lines 31\-34\) 3. src/app\_runtime/control/http\_app.py:app.get \(lines 38\-42\)
|
||||
- **plba-v2-find-entrypoints-health-endpoint**
|
||||
Query: Где health endpoint?
|
||||
> health endpoint: \- src/app\_runtime/control/http\_app.py:38\-42 \(app.post\) \- src/app\_runtime/control/http\_app.py:31\-34 \(app.get\)
|
||||
- **plba-v2-trace-flow-runtime-start**
|
||||
Query: Покажи поток выполнения при запуске RuntimeManager
|
||||
> 1. Запускается \`RuntimeManager\` через импорт в \`bootstrap.py\` \(\`src/plba/bootstrap.py:4\`\). 2. Далее, в \`control/service.py\`, происходит повторный импорт и переопределение переменной \`RuntimeManager\` как \`app\_runtime.core.runtime.RuntimeManager\` \(\`src/app\_runtime/control/service.py:9\`\). 3. В файле \`core/runtime.py\` начинается определение класса \`RuntimeManager\`. Этот класс управляет состоянием приложения и участвует в управлении жизненным циклом различных сервисов и модулей \(\`src/app\_runtime/core/runtime.py:18\-179\`\). 4. Из \`\_\_init\_\_.py\` модуля \`plba\` \(\`src/plba/\_\_init\_\_.py:16\`\) импортируется другой экземпляр \`RuntimeManager\`. 5. Затем идет обращение к инициализации объекта \`ControlPlaneService\` в модуле \`control/service.py\` \(\`src/app\_runtime/control/service.py:12\-52\`\), который регистрирует каналы управления. 6. Контроллер канала управления определяется в \`base.py\` фай…
|
||||
- **plba-v2-trace-flow-health-endpoint**
|
||||
Query: Покажи как проходит запрос /health в HttpControlAppFactory
|
||||
> 1. HttpControlAppFactory.create\(health\_provider, action\_provider\) \- Создает FastAPI приложение. \- Добавляет middleware для логирования времени ответа. \- Обрабатывает GET запрос к "/health". 2. HttpControlAppFactory.create.health\(\) \- Вызывается при обработке запроса "/health". \- Возвращает Awaitable объект типа HealthPayload. 3. HttpControlAppFactory.create.action\_provider\(\) \- Определяет поведение при запросе действий. Полный поток вызова от обработки запроса "/health" до получения HealthPayload отсутствует в предоставленных доказательствах.
|
||||
- **plba-v2-architecture-runtime-manager**
|
||||
Query: Какие компоненты участвуют в RuntimeManager?
|
||||
> \#\#\# Подтвержденные Связи 1. \*\*RuntimeManager\*\*: \- Является ключевым компонентом управления жизненным циклом приложения. \- Инициализирует и управляет другими компонентами системы через метод \`\_\_init\_\_\`. 2. \*\*ControlPlaneService\*\*: \- Управляет каналами контроля. \- Вызывается из метода инициализации \`RuntimeManager\` для регистрации каналов. 3. \*\*ControlChannel\*\*: \- Абстрактный класс для реализации конкретных каналов контроля. \- Реализует методы \`start\` и \`stop\`, которые вызываются сервисами и менеджерами. 4. \*\*ConfigFileLoader\*\*: \- Загружает конфигурационные файлы и передает их в runtime\-менеджер. 5. \*\*WorkflowPersistence\*\*: \- Обеспечивает сохранение информации о workflows. 6. \*\*InMemoryTaskQueue\*\*: \- Используется для хранения задач внутри памяти. 7. \*\*TraceContextStore\*\*: \- Хранит контекст трассировки. 8. \*\*WorkerSupervisor\*\*: \- Наблюдает за рабочими процессами и управ…
|
||||
- **plba-v2-architecture-control-plane**
|
||||
Query: Какие компоненты участвуют в ControlPlaneService?
|
||||
> \#\#\# Подтвержденные Связи 1. \*\*ControlPlaneService\*\*: \- Вызывает методы инициализации \(\`\_channels\`, \`\_start\_async\`, \`register\_channel\`, \`start\`, \`stop\`, \`\_stop\_async\`\) \[evidence: 16\-20\]. 2. \*\*ControlPlaneService\*\* взаимодействует с другими компонентами через методы регистрации каналов и запуска: \- Регистрация канала \(\`register\_channel\`\) использует атрибут \`\_channels\` для хранения списка зарегистрированных каналов \[evidence: 22\]. \- Запуск сервиса использует метод \`start\`, который также обращается к атрибуту \`\_channels\` \[evidence: 23\]. \#\#\# Роли Компонентов 1. \*\*ControlPlaneService\*\*: \- Pipeline stage: отвечает за чтение и запись состояния атрибутов, участвует в данных срезах \(dataflow slices\). 2. \*\*ControlChannel\*\*: \- Model: выполняет функции модели управления каналами, включая запуск и остановку. 3. \*\*ControlActionSet\*\*: \- Default model role: обеспечивает стандартные д…
|
||||
- **plba-v2-explain-nonexistent-symbol**
|
||||
Query: Объясни класс RuntimeFactoryManager
|
||||
> Класс \`RuntimeFactoryManager\` не найден в предоставленном коде или контекстной информации. Ключевые шаги и опорные файлы: 1. Код и контекста относятся к управлению каналами управления \(«control channels»\) в приложении. 2. Основные классы включают \`ControlChannel\`, \`ControlActionSet\`, и связанные с ними каналы и сервисы. 3. Основной файл для рассмотрения — \`base.py\`. 4. Ключевые обязанности и интерфейсы описаны через абстрактные методы \(\`start\`, \`stop\`\) в классе \`ControlChannel\`. Поскольку конкретный класс \`RuntimeFactoryManager\` отсутствует в данном контексте, невозможно предоставить его объяснение.
|
||||
- **plba-v2-open-file-nonexistent**
|
||||
Query: Открой файл src/app_runtime/core/missing_runtime.py
|
||||
> Файл \`src/app\_runtime/core/missing\_runtime.py\` не найден.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
# 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: 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\n1. **ControlPlaneService** – главный сервис, инициализирующий и управляющий каналами контроля. Он создает каналы, регистрирует их и управляет жизненным циклом через методы `register_channel`, `start` и `stop`.\n - Создаёт экземпляры каналов (`ControlChannel`) и сохраняет их в поле `_channels`.\n - Вызывает асинхронную инициализацию каналов с помощью методов `start` и `stop`.\n\n2. **ControlChannel** – абстрактный базовый класс для каналов управления, определяющий интерфейс для старта и остановки канала.\n - Описывает абстракции для начала работы канала и освобождения ресурсов при завершении.\n\n3. **ControlActionSet** – модель действий, используемых в канале управления.\n\nСвязи между компонентами реализованы следующим образом:\n- **ControlPlaneService** создаёт и регистрирует экземпляры каналов управления через метод `register_channel`.\n- Каналы управления (например, HttpControlChannel) используют общий интерфейс `ControlChannel` для реализации своих функций старта и завершения.\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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user