142 lines
5.8 KiB
Python
142 lines
5.8 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
def test_runtime_modules_no_longer_keep_legacy_business_heuristic_helpers() -> None:
|
|
repo_root = Path(__file__).resolve().parents[1]
|
|
expectations = {
|
|
"app/services/signal/signal_capture_service/mixin_capture_entry.py": (
|
|
"_is_question_like",
|
|
),
|
|
"app/services/signal/signal_capture_service/mixin_analysis_normalize.py": (
|
|
"_is_question_like",
|
|
),
|
|
"app/services/signal/signal_capture_service/mixin_pipeline_cache.py": (
|
|
"_is_question_like",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_message_utils_a.py": (
|
|
"_is_water_talk_message",
|
|
"_is_requirement_like_question",
|
|
"_extract_requirement_statement_from_question",
|
|
"_convert_requirement_question_to_signal_text",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_lookup_and_block.py": (
|
|
"_is_project_lookup_question",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_message_utils_b.py": (
|
|
"_is_simple_signal_source_request",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_extraction.py": (
|
|
"_heuristic_level_fallback",
|
|
"_heuristic_signal_fallback",
|
|
"_heuristic_project_prefill_fallback",
|
|
),
|
|
"app/services/ai_pmo/ai_pmo_kernel/mixins/intent/ai_pmo_kernel_mixins_intent_rules.py": (
|
|
"_has_question_structure",
|
|
),
|
|
"app/services/reply_iteration/service.py": (
|
|
"EXECUTION_CLAIM_TOKENS",
|
|
),
|
|
"app/services/integrations/feishu_integration_service/mixin_reply_llm_core.py": (
|
|
"_is_capability_question",
|
|
),
|
|
"app/services/integrations/feishu_integration_service/mixin_receive_routing.py": (
|
|
"_is_feishu_signal_source_recommendation_question",
|
|
"_pick_feishu_entity_by_keywords",
|
|
"_looks_like_feishu_raw_internal_state_reply",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_intent_gate_core.py": (
|
|
"_extract_project_scope",
|
|
"_extract_project_intent_fields",
|
|
"_is_contextual_project_request",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_context_prefill_a.py": (
|
|
"_is_placeholder_project_text",
|
|
"_is_project_request_artifact",
|
|
"_guess_project_title_from_text",
|
|
"_extract_embedded_project_context",
|
|
"_derive_project_title_from_context",
|
|
),
|
|
"app/services/integrations/feishu_signal_pipeline/mixin_context_prefill_b.py": (
|
|
"heuristic_title",
|
|
"heuristic_description",
|
|
"heuristic_scope",
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_followup_anchor.py": (
|
|
"_normalize_followup_selection_text",
|
|
"_parse_followup_choice_index",
|
|
),
|
|
"app/services/analysis_packet_builder.py": (
|
|
"_GENERIC_FIT_PLACEHOLDERS",
|
|
"_is_generic_fit_placeholder",
|
|
"_looks_like_engineering_task",
|
|
"_looks_like_signal_placeholder",
|
|
"_task_presentation_hint",
|
|
"_TOKEN_PATTERN",
|
|
"_text_overlap_score",
|
|
"_match_preferred_name",
|
|
"_task_signal_score_map",
|
|
"_signal_task_link_rows",
|
|
),
|
|
"app/services/analysis_project_snapshot_loader.py": (
|
|
"_TOKEN_PATTERN",
|
|
"_text_overlap_score",
|
|
"_task_presentation_score",
|
|
"_signal_prefix",
|
|
"_pick_signal_contrast_refs",
|
|
"task_signal_scores",
|
|
"signal_task_links",
|
|
"presentation_task_title",
|
|
"core_chain_task_title",
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_target_resolution.py": (
|
|
"_referenced_objects",
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_core_intent.py": (
|
|
"_normalize_semantic_subject_focus",
|
|
"_normalize_query_profile_object",
|
|
'"subject_focus"',
|
|
'"referenced_objects"',
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_query_route_gateway.py": (
|
|
'"referenced_objects"',
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_session_state.py": (
|
|
'"referenced_objects"',
|
|
),
|
|
"app/services/adaptive_rag_service/mixin_fast_answer_project_utils.py": (
|
|
"_query_subject_focus",
|
|
"_SEMANTIC_SUBJECT_FOCI",
|
|
),
|
|
"app/config/ai_prompts.py": (
|
|
'"subject_focus"',
|
|
'"referenced_objects"',
|
|
),
|
|
}
|
|
|
|
for relative_path, forbidden_tokens in expectations.items():
|
|
source = (repo_root / relative_path).read_text(encoding="utf-8")
|
|
for token in forbidden_tokens:
|
|
assert token not in source, f"{relative_path} still contains {token}"
|
|
|
|
|
|
def test_runtime_modules_no_longer_reference_classify_intent_complex() -> None:
|
|
repo_root = Path(__file__).resolve().parents[1]
|
|
runtime_files = (
|
|
"app/core/startup/model_probe.py",
|
|
"app/services/ai_pmo/ai_pmo_typed_executor_discovery/mixin_context.py",
|
|
"app/services/ai_pmo/ai_pmo_kernel_common_core/env.py",
|
|
"app/services/llm_service/mixin_guardrails_prompt.py",
|
|
"app/services/llm_service/mixin_generate_db_structured.py",
|
|
"app/services/llm_service/mixin_structured_candidates.py",
|
|
"app/services/llm_service/shared_part_01.py",
|
|
"app/services/model/model_routing/service.py",
|
|
"app/services/model/model_context_bundle/shared.py",
|
|
"app/services/model/model_context_bundle/mixin_core.py",
|
|
)
|
|
|
|
for relative_path in runtime_files:
|
|
source = (repo_root / relative_path).read_text(encoding="utf-8")
|
|
assert "classify_intent_complex" not in source, relative_path
|