From 987b15d4ffe0212710cac163e2ec966eb73764a6 Mon Sep 17 00:00:00 2001 From: team 1 Date: Thu, 7 May 2026 15:29:05 +0200 Subject: [PATCH] p59c --- config/retriex/genre.yaml | 135 ++++++++++++------ ...GENRE_REVIEW_PATH_CLASSIFICATION_README.md | 72 ++++++++++ public/assets/styles/base.css | 3 +- src/Config/RetriexEffectiveConfigProvider.php | 38 +++++ 4 files changed, 204 insertions(+), 44 deletions(-) create mode 100644 patch_history/RETRIEX_PATCH_59C_GENRE_REVIEW_PATH_CLASSIFICATION_README.md diff --git a/config/retriex/genre.yaml b/config/retriex/genre.yaml index d62f284..ca41017 100644 --- a/config/retriex/genre.yaml +++ b/config/retriex/genre.yaml @@ -7,8 +7,9 @@ # # p54 introduced `adaptation_surface` as the migration inventory. p55 adds # `configuration_values` as the central value surface. p59B keeps the -# adaptation surface focused on native genre value paths plus explicitly -# reviewable non-empty technical/frozen legacy paths. +# adaptation surface focused on native genre value paths. p59C adds +# review_path_groups so every remaining non-empty/runtime-resolved legacy +# source path is visible with its cleanup classification. parameters: retriex.genre.config: id: water_analysis @@ -25,20 +26,33 @@ parameters: - configuration_values.product_roles.shop_views - configuration_values.product_roles.prompt_views - configuration_values.product_roles.no_llm_fallback_terms - review_paths: - - agent.no_llm_fallback.product_roles.vocabulary_views.main_device_request_keywords - - agent.no_llm_fallback.product_roles.vocabulary_views.accessory_product_keywords + review_path_groups: + frozen_compatibility_views: + description: Legacy no-LLM product-role vocabulary views. Keep frozen until the fallback reads only from genre.configuration_values.product_roles. + paths: + - agent.no_llm_fallback.product_roles.vocabulary_views.main_device_request_keywords + - agent.no_llm_fallback.product_roles.vocabulary_views.accessory_product_keywords product_attributes: description: Genre-specific attributes and constraints, for example measurement values now or size/color/material later. value_paths: - configuration_values.product_attributes.direct_attribute_cleanup - configuration_values.product_attributes.size_and_color_terms - configuration_values.product_attributes.numeric_length_constraints - review_paths: - - intent.commerce.patterns.size_extraction_template - - intent.commerce.patterns.size_value_template - - intent.commerce.patterns.size_token_value_template - - intent.commerce.patterns.color_value_template + review_path_groups: + frozen_runtime_views: + description: Legacy shop-runtime attribute and length helpers mirrored by genre values. Rewire candidates, not user-facing maintenance paths. + paths: + - agent.shop_runtime.attribute_cleanup.vocabulary_views.product_type_terms + - agent.shop_runtime.attribute_cleanup.vocabulary_views.stop_terms + - agent.shop_runtime.answer_constraints.length_sort + - agent.shop_runtime.answer_constraints.length_filter + regex_templates: + description: Intent regex templates that still belong to the technical matcher layer and should remain frozen while genre terms live in configuration_values. + paths: + - intent.commerce.patterns.size_extraction_template + - intent.commerce.patterns.size_value_template + - intent.commerce.patterns.size_token_value_template + - intent.commerce.patterns.color_value_template brands_and_canonical_terms: description: Known brands, canonical token mappings and query enrichment rules that change with the shop genre. value_paths: @@ -53,13 +67,23 @@ parameters: - configuration_values.intent_and_routing.fuzzy_routing_terms - configuration_values.intent_and_routing.commerce_intent - configuration_values.intent_and_routing.sales_intent - review_paths: - - intent.commerce.patterns.model_like_product - - intent.sales.sales_signals - - intent.sales.comparison_signals - - intent.sales.objection_signals - - intent.sales.implementation_signals - - intent.sales.roi_signals + review_path_groups: + frozen_runtime_views: + description: Legacy fuzzy-routing vocabulary view kept only as frozen compatibility metadata until routing uses the genre value directly. + paths: + - agent.input_normalization.fuzzy_routing.vocabulary_views.terms + regex_templates: + description: Commerce intent regex template for model-like product terms; technical matcher fallback, not a genre maintenance list. + paths: + - intent.commerce.patterns.model_like_product + sales_signal_fallbacks: + description: Sales/advisory signal lists mirrored by genre values and frozen to prevent drift outside genre.yaml. + paths: + - intent.sales.sales_signals + - intent.sales.comparison_signals + - intent.sales.objection_signals + - intent.sales.implementation_signals + - intent.sales.roi_signals context_resolution: description: Follow-up anchors and meta-query handling for referential shop questions in the current genre. value_paths: @@ -68,11 +92,18 @@ parameters: - configuration_values.context_resolution.history_anchor_enrichment - configuration_values.context_resolution.meta_query_guard - configuration_values.context_resolution.rag_anchor_enrichment - review_paths: - - agent.follow_up_context.commercial_table_follow_up.history_anchor_patterns - - agent.follow_up_context.commercial_table_follow_up.indicator_marker_patterns - - agent.follow_up_context.commercial_table_follow_up.query_template_with_model - - agent.follow_up_context.commercial_table_follow_up.query_template_without_model + review_path_groups: + frozen_runtime_views: + description: Legacy history-anchor trigger view mirrored by genre values. Candidate for later runtime accessor cleanup. + paths: + - agent.shop_runtime.context_resolution.history_anchor_enrichment.vocabulary_views.trigger_terms + commercial_follow_up_fallbacks: + description: Commercial follow-up anchor patterns and query templates kept frozen while the follow-up resolver is migrated fully to genre values. + paths: + - agent.follow_up_context.commercial_table_follow_up.history_anchor_patterns + - agent.follow_up_context.commercial_table_follow_up.indicator_marker_patterns + - agent.follow_up_context.commercial_table_follow_up.query_template_with_model + - agent.follow_up_context.commercial_table_follow_up.query_template_without_model shop_query_runtime: description: Shop query cleanup and direct Shopware search behavior that needs genre-specific terms but no PHP branching. value_paths: @@ -82,6 +113,11 @@ parameters: - configuration_values.shop_query_runtime.primary_identity_repair - configuration_values.shop_query_runtime.semantic_shop_search_tokens - configuration_values.shop_query_runtime.direct_answer + review_path_groups: + frozen_runtime_views: + description: Legacy current-input preservation vocabulary view mirrored by genre values and kept frozen until the query optimizer reads only from genre.yaml. + paths: + - agent.shop_runtime.query_cleanup.current_input_preservation.vocabulary_views.terms result_identity_and_answer_policy: description: Grounding, role separation and atomicity rules that must match the active product genre. value_paths: @@ -96,13 +132,16 @@ parameters: - configuration_values.search_repair.requested_accessory_code_terms - configuration_values.search_repair.candidate_patterns - configuration_values.search_repair.candidate_terms - review_paths: - - search_repair.patterns.model_candidate - - search_repair.patterns.accessory_candidate_template - - search_repair.patterns.requested_accessory_code - - search_repair.patterns.accessory_or_bundle_template - - search_repair.patterns.model_like - - search_repair.patterns.specificity_boost_template + review_path_groups: + regex_templates: + description: Search-repair regex templates still owned by the technical matcher layer. Frozen source paths prevent silent divergence from genre values. + paths: + - search_repair.patterns.model_candidate + - search_repair.patterns.accessory_candidate_template + - search_repair.patterns.requested_accessory_code + - search_repair.patterns.accessory_or_bundle_template + - search_repair.patterns.model_like + - search_repair.patterns.specificity_boost_template retrieval_and_language: description: Genre-specific protected terms, exact selection helpers and retrieval vocabulary. Engine parameters stay outside this surface. value_paths: @@ -110,10 +149,13 @@ parameters: - configuration_values.retrieval_and_language.cleanup_profiles - configuration_values.retrieval_and_language.retrieval_vocabulary_views - configuration_values.retrieval_and_language.exact_selection - review_paths: - - language.cleanup_profiles.commerce_query - - language.cleanup_profiles.rag_evidence - - language.cleanup_profiles.shop_context_fallback + review_path_groups: + technical_cleanup_profiles: + description: Shared language cleanup profiles with runtime structure beyond simple genre vocabulary. Keep as technical review paths until a dedicated cleanup-profile migration removes the legacy copies. + paths: + - language.cleanup_profiles.commerce_query + - language.cleanup_profiles.rag_evidence + - language.cleanup_profiles.shop_context_fallback shop_data_mapping: description: Shop record fields and matching text fields that are installation-/genre-specific. value_paths: @@ -121,21 +163,30 @@ parameters: - configuration_values.shop_data_mapping.text - configuration_values.shop_data_mapping.role_guard - configuration_values.shop_data_mapping.commerce_connection - review_paths: - - shop_matching.custom_fields - - shop_matching.text.custom_field_join_separator - - shop_matching.text.primary_secondary_separator - - shop_matching.role_guard - - commerce.store_api_base_url - - commerce.max_shop_results + review_path_groups: + technical_shop_mapping: + description: Shop matching field and role-guard configuration. Installation-specific, but still technical runtime mapping rather than simple genre vocabulary. + paths: + - shop_matching.custom_fields + - shop_matching.text.custom_field_join_separator + - shop_matching.text.primary_secondary_separator + - shop_matching.role_guard + runtime_resolved_connection: + description: Runtime environment values intentionally allowed by governance as resolved outside genre.yaml. + paths: + - commerce.store_api_base_url + - commerce.max_shop_results governance_and_regression: description: Guardrails and regression expectations that intentionally protect the active genre. value_paths: - configuration_values.governance_and_regression.regression_baseline - configuration_values.governance_and_regression.vocabulary_guardrails - configuration_values.governance_and_regression.core_pattern_audit - review_paths: - - governance.core_pattern_audit + review_path_groups: + governance_guardrails: + description: Technical audit policy for core-pattern checks. Keep outside genre values but visible in the adaptation surface. + paths: + - governance.core_pattern_audit configuration_values: product_roles: description: Current water-analysis product role vocabulary. For another genre, replace these terms with that genre's main-product, accessory and consumable roles. diff --git a/patch_history/RETRIEX_PATCH_59C_GENRE_REVIEW_PATH_CLASSIFICATION_README.md b/patch_history/RETRIEX_PATCH_59C_GENRE_REVIEW_PATH_CLASSIFICATION_README.md new file mode 100644 index 0000000..0653635 --- /dev/null +++ b/patch_history/RETRIEX_PATCH_59C_GENRE_REVIEW_PATH_CLASSIFICATION_README.md @@ -0,0 +1,72 @@ +# RetrieX Patch 59C - Genre Review Path Classification + +## Ziel + +p59C räumt die nach p59A/p59B verbliebene Genre-Migrationsoberfläche weiter auf, ohne Runtime-, Retrieval-, Prompt-, Shop- oder Scoring-Logik zu ändern. + +Der Patch ersetzt die flachen `adaptation_surface.*.review_paths` in `config/retriex/genre.yaml` durch klassifizierte `review_path_groups`. + +## Warum + +Nach p59B waren 32 alte technische/frozen Pfade als `review_paths` sichtbar. Zusätzlich existierten noch 7 deklarierte `configuration_values.*.source_paths`, die nicht in der `adaptation_surface` sichtbar klassifiziert waren. + +p59C macht alle verbliebenen 39 Legacy-/Runtime-Source-Pfade sichtbar und ordnet sie nach Cleanup-Bedeutung: + +- `frozen_compatibility_views` +- `frozen_runtime_views` +- `regex_templates` +- `sales_signal_fallbacks` +- `commercial_follow_up_fallbacks` +- `technical_cleanup_profiles` +- `technical_shop_mapping` +- `runtime_resolved_connection` +- `governance_guardrails` + +Damit ist klarer erkennbar, welche Pfade technische Runtime-Fallbacks, Regex-Templates, Runtime-resolved Werte oder spätere Rewire-Kandidaten sind. + +## Geänderte Dateien + +- `config/retriex/genre.yaml` +- `src/Config/RetriexEffectiveConfigProvider.php` + +## Technische Änderung + +`validateGenre()` akzeptiert zusätzlich zu den alten flachen `review_paths` jetzt strukturierte `review_path_groups`: + +```yaml +review_path_groups: + frozen_runtime_views: + description: ... + paths: + - agent.shop_runtime.... +``` + +Das alte Feld `review_paths` bleibt validatorseitig rückwärtskompatibel, wird in `genre.yaml` aber nicht mehr verwendet. + +## Nicht geändert + +- keine Runtime-Logik +- keine Query-Logik +- keine Retrieval-Logik +- keine Prompt-Logik +- keine Shop-Logik +- keine Scoring-Logik +- keine Hash-/Governance-Werte + +## Lokale Checks + +In der entpackten ZIP ohne `vendor/` lokal geprüft: + +- YAML parsebar +- PHP-Lint für `RetriexEffectiveConfigProvider.php` grün +- alle 39 `configuration_values.*.source_paths` sind in `adaptation_surface.*.review_path_groups.*.paths` klassifiziert +- keine zusätzlichen oder fehlenden klassifizierten Source-Pfade + +Die Symfony-Checks müssen im Projekt mit installiertem `vendor/` laufen: + +```bash +bin/console mto:agent:config:validate +bin/console mto:agent:regression:test +bin/console mto:agent:config:audit-source --details +bin/console mto:agent:config:audit-patterns --details +``` diff --git a/public/assets/styles/base.css b/public/assets/styles/base.css index fd5e784..61b7a01 100644 --- a/public/assets/styles/base.css +++ b/public/assets/styles/base.css @@ -487,8 +487,7 @@ span.think { } .retriex-chat-options { - display: flex -; + display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.25rem; diff --git a/src/Config/RetriexEffectiveConfigProvider.php b/src/Config/RetriexEffectiveConfigProvider.php index 5fc0adc..a3d1aae 100644 --- a/src/Config/RetriexEffectiveConfigProvider.php +++ b/src/Config/RetriexEffectiveConfigProvider.php @@ -1238,6 +1238,44 @@ final readonly class RetriexEffectiveConfigProvider } } } + + + $reviewPathGroups = $definition['review_path_groups'] ?? null; + if (array_key_exists('review_path_groups', $definition)) { + if (!is_array($reviewPathGroups) || $reviewPathGroups === []) { + $errors[] = sprintf('genre.adaptation_surface.%s.review_path_groups must be a non-empty map when declared.', $group); + continue; + } + + foreach ($reviewPathGroups as $reviewGroup => $reviewDefinition) { + if (!is_string($reviewGroup) || trim($reviewGroup) === '') { + $errors[] = sprintf('genre.adaptation_surface.%s.review_path_groups keys must be non-empty strings.', $group); + continue; + } + if (!is_array($reviewDefinition)) { + $errors[] = sprintf('genre.adaptation_surface.%s.review_path_groups.%s must be a map.', $group, $reviewGroup); + continue; + } + + $paths = $reviewDefinition['paths'] ?? null; + if (!is_array($paths) || $paths === []) { + $errors[] = sprintf('genre.adaptation_surface.%s.review_path_groups.%s.paths must be a non-empty list.', $group, $reviewGroup); + continue; + } + + foreach ($paths as $path) { + if (!is_string($path) || trim($path) === '') { + $errors[] = sprintf('genre.adaptation_surface.%s.review_path_groups.%s.paths must contain non-empty strings.', $group, $reviewGroup); + continue; + } + + $path = trim($path); + if (!isset($flattened[$path])) { + $warnings[] = sprintf('genre.adaptation_surface.%s.review_path_groups.%s references unknown review path: %s.', $group, $reviewGroup, $path); + } + } + } + } } foreach ($this->collectGenreConfigurationValueSourcePaths($configurationValues) as $valuePath => $sourcePaths) {