fix p53
This commit is contained in:
@@ -655,6 +655,99 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
'ignore_patterns' => $this->agentRunnerConfig->getFinalAnswerRepeatedLineIgnorePatterns(),
|
||||
],
|
||||
],
|
||||
'shop_runtime' => [
|
||||
'query_cleanup' => [
|
||||
'current_input_preservation' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryCurrentInputPreservationEnabled(),
|
||||
'terms' => $this->agentRunnerConfig->getShopQueryCurrentInputPreservationTerms(),
|
||||
],
|
||||
'stopword_cleanup' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryStopwordCleanupEnabled(),
|
||||
'min_query_tokens_after_cleanup' => $this->agentRunnerConfig->getShopQueryStopwordCleanupMinTokens(),
|
||||
'terms' => $this->agentRunnerConfig->getShopQueryStopwordCleanupTerms(),
|
||||
],
|
||||
],
|
||||
'attribute_cleanup' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryProductAttributeCleanupEnabled(),
|
||||
'min_query_tokens_after_cleanup' => $this->agentRunnerConfig->getShopQueryProductAttributeCleanupMinTokens(),
|
||||
'product_type_terms' => $this->agentRunnerConfig->getShopQueryProductAttributeCleanupProductTypeTerms(),
|
||||
'stop_terms' => $this->agentRunnerConfig->getShopQueryProductAttributeCleanupStopTerms(),
|
||||
'comparative_constraint_patterns' => $this->agentRunnerConfig->getShopQueryProductAttributeCleanupComparativeConstraintPatterns(),
|
||||
],
|
||||
'context_resolution' => [
|
||||
'context_usage' => [
|
||||
'referential_terms' => $this->agentRunnerConfig->getShopQueryContextUsageReferentialTerms(),
|
||||
],
|
||||
'history_anchor_enrichment' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryContextAnchorEnrichmentEnabled(),
|
||||
'max_query_terms' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentMaxQueryTerms(),
|
||||
'trigger_terms' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentTriggerTerms(),
|
||||
'anchor_patterns' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentPatterns(),
|
||||
'template' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentTemplate(),
|
||||
],
|
||||
'meta_query_guard' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryMetaGuardEnabled(),
|
||||
'cleanup_profile' => $this->agentRunnerConfig->getShopQueryContextFallbackCleanupProfile(),
|
||||
'context_fallback_use_full_history' => $this->agentRunnerConfig->shouldUseFullHistoryForShopQueryContextFallback(),
|
||||
'meta_only_terms' => $this->agentRunnerConfig->getShopQueryMetaOnlyTerms(),
|
||||
'context_fallback_enabled' => $this->agentRunnerConfig->isShopQueryContextFallbackEnabled(),
|
||||
'context_fallback_question_limit' => $this->agentRunnerConfig->getShopQueryContextFallbackQuestionLimit(),
|
||||
'context_fallback_history_budget_chars' => $this->agentRunnerConfig->getShopQueryContextFallbackHistoryBudgetChars(),
|
||||
'context_fallback_max_terms' => $this->agentRunnerConfig->getShopQueryContextFallbackMaxTerms(),
|
||||
'context_fallback_filter_terms' => $this->agentRunnerConfig->getShopQueryContextFallbackFilterTerms(),
|
||||
],
|
||||
'rag_anchor_enrichment' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryRagAnchorEnrichmentEnabled(),
|
||||
'min_score' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentMinScore(),
|
||||
'max_query_terms' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentMaxQueryTerms(),
|
||||
'early_chunk_bonus_max' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentEarlyChunkBonusMax(),
|
||||
'template' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentTemplate(),
|
||||
'scores' => [
|
||||
'exact_value_with_unit' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentExactValueUnitScore(),
|
||||
'exact_value_only' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentExactValueScore(),
|
||||
'anchor_bonus' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentAnchorBonusScore(),
|
||||
],
|
||||
'numeric_focus_patterns' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentNumericFocusPatterns(),
|
||||
'product_title_patterns' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentProductTitlePatterns(),
|
||||
'anchor_bonus_patterns' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentAnchorBonusPatterns(),
|
||||
'subject_terms' => $this->agentRunnerConfig->getShopQueryRagAnchorEnrichmentSubjectTerms(),
|
||||
],
|
||||
],
|
||||
'result_identity' => [
|
||||
'enabled' => $this->agentRunnerConfig->isDirectShopResultGuardEnabled(),
|
||||
'prefer_primary_identity_matches' => $this->agentRunnerConfig->shouldPreferDirectShopResultGuardPrimaryIdentityMatches(),
|
||||
'compound_prefix_match' => [
|
||||
'enabled' => $this->agentRunnerConfig->isDirectShopResultGuardCompoundPrefixMatchEnabled(),
|
||||
'terms' => $this->agentRunnerConfig->getDirectShopResultGuardCompoundPrefixTerms(),
|
||||
],
|
||||
'primary_identity_repair' => [
|
||||
'enabled' => $this->agentRunnerConfig->isDirectShopResultGuardPrimaryIdentityRepairEnabled(),
|
||||
'min_query_tokens_after_cleanup' => $this->agentRunnerConfig->getDirectShopResultGuardPrimaryIdentityRepairMinQueryTokens(),
|
||||
'stop_terms' => $this->agentRunnerConfig->getDirectShopResultGuardPrimaryIdentityRepairStopTerms(),
|
||||
],
|
||||
],
|
||||
'answer_constraints' => [
|
||||
'length_sort' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopResultLengthSortEnabled(),
|
||||
'trigger_patterns' => $this->agentRunnerConfig->getShopResultLengthSortTriggerPatterns(),
|
||||
'value_patterns' => $this->agentRunnerConfig->getShopResultLengthSortValuePatterns(),
|
||||
],
|
||||
'length_filter' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopResultLengthFilterEnabled(),
|
||||
'min_patterns' => $this->agentRunnerConfig->getShopResultMinLengthFilterPatterns(),
|
||||
'max_patterns' => $this->agentRunnerConfig->getShopResultMaxLengthFilterPatterns(),
|
||||
],
|
||||
],
|
||||
'direct_answer' => [
|
||||
'enabled' => $this->agentRunnerConfig->isDirectShopResultAnswerEnabled(),
|
||||
'max_results' => $this->agentRunnerConfig->getDirectShopResultAnswerMaxResults(),
|
||||
'intro' => $this->agentRunnerConfig->getDirectShopResultAnswerIntro(),
|
||||
'no_results' => $this->agentRunnerConfig->getDirectShopResultAnswerNoResultsMessage(),
|
||||
'sorted_by_length_note' => $this->agentRunnerConfig->getDirectShopResultAnswerSortedByLengthNote(),
|
||||
'min_length_filter_note' => $this->agentRunnerConfig->getDirectShopResultAnswerMinLengthFilterNote(),
|
||||
'max_length_filter_note' => $this->agentRunnerConfig->getDirectShopResultAnswerMaxLengthFilterNote(),
|
||||
],
|
||||
],
|
||||
'rag_evidence_guard' => [
|
||||
'cleanup_profile' => $this->agentRunnerConfig->getRagEvidenceCleanupProfile(),
|
||||
'stop_terms' => $this->agentRunnerConfig->getRagEvidenceStopTerms(),
|
||||
@@ -691,31 +784,6 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
'language_markers' => $this->agentRunnerConfig->getShopQueryLanguageMarkers(),
|
||||
'translation_replacements_de' => $this->agentRunnerConfig->getShopQueryTranslationReplacements('de'),
|
||||
],
|
||||
'context_usage' => [
|
||||
'referential_terms' => $this->agentRunnerConfig->getShopQueryContextUsageReferentialTerms(),
|
||||
],
|
||||
'current_input_preservation' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryCurrentInputPreservationEnabled(),
|
||||
'terms' => $this->agentRunnerConfig->getShopQueryCurrentInputPreservationTerms(),
|
||||
],
|
||||
'context_anchor_enrichment' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryContextAnchorEnrichmentEnabled(),
|
||||
'max_query_terms' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentMaxQueryTerms(),
|
||||
'trigger_terms' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentTriggerTerms(),
|
||||
'anchor_patterns' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentPatterns(),
|
||||
'template' => $this->agentRunnerConfig->getShopQueryContextAnchorEnrichmentTemplate(),
|
||||
],
|
||||
'meta_query_guard' => [
|
||||
'enabled' => $this->agentRunnerConfig->isShopQueryMetaGuardEnabled(),
|
||||
'cleanup_profile' => $this->agentRunnerConfig->getShopQueryContextFallbackCleanupProfile(),
|
||||
'context_fallback_use_full_history' => $this->agentRunnerConfig->shouldUseFullHistoryForShopQueryContextFallback(),
|
||||
'meta_only_terms' => $this->agentRunnerConfig->getShopQueryMetaOnlyTerms(),
|
||||
'context_fallback_enabled' => $this->agentRunnerConfig->isShopQueryContextFallbackEnabled(),
|
||||
'context_fallback_question_limit' => $this->agentRunnerConfig->getShopQueryContextFallbackQuestionLimit(),
|
||||
'context_fallback_history_budget_chars' => $this->agentRunnerConfig->getShopQueryContextFallbackHistoryBudgetChars(),
|
||||
'context_fallback_max_terms' => $this->agentRunnerConfig->getShopQueryContextFallbackMaxTerms(),
|
||||
'context_fallback_filter_terms' => $this->agentRunnerConfig->getShopQueryContextFallbackFilterTerms(),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -1281,8 +1349,10 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
$this->validateStringList($this->toList($ragEvidence['aggregate_evidence_terms'] ?? []), 'agent.rag_evidence_guard.aggregate_evidence_terms', $errors, $warnings);
|
||||
$this->validateRegexPatternList($ragEvidence['aggregate_answer_evidence_patterns'] ?? [], 'agent.rag_evidence_guard.aggregate_answer_evidence_patterns', $errors);
|
||||
|
||||
$shopPrompt = is_array($agent['shop_prompt'] ?? null) ? $agent['shop_prompt'] : [];
|
||||
$metaQueryGuard = is_array($shopPrompt['meta_query_guard'] ?? null) ? $shopPrompt['meta_query_guard'] : [];
|
||||
$shopRuntime = is_array($agent['shop_runtime'] ?? null) ? $agent['shop_runtime'] : [];
|
||||
$queryCleanup = is_array($shopRuntime['query_cleanup'] ?? null) ? $shopRuntime['query_cleanup'] : [];
|
||||
$contextResolution = is_array($shopRuntime['context_resolution'] ?? null) ? $shopRuntime['context_resolution'] : [];
|
||||
$metaQueryGuard = is_array($contextResolution['meta_query_guard'] ?? null) ? $contextResolution['meta_query_guard'] : [];
|
||||
$shopContextCleanupProfile = $metaQueryGuard['cleanup_profile'] ?? null;
|
||||
if (!is_string($shopContextCleanupProfile) || trim($shopContextCleanupProfile) === '') {
|
||||
$shopContextCleanupProfile = $this->agentRunnerConfig->getShopQueryContextFallbackCleanupProfile();
|
||||
@@ -1290,16 +1360,16 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
$shopContextCleanupProfile = trim($shopContextCleanupProfile);
|
||||
}
|
||||
if (!in_array($shopContextCleanupProfile, $this->languageCleanupConfig->getCleanupProfileNames(), true)) {
|
||||
$errors[] = 'agent.shop_prompt.meta_query_guard.cleanup_profile references unknown language cleanup profile: ' . $shopContextCleanupProfile . '.';
|
||||
$errors[] = 'agent.shop_runtime.context_resolution.meta_query_guard.cleanup_profile references unknown language cleanup profile: ' . $shopContextCleanupProfile . '.';
|
||||
}
|
||||
|
||||
$currentInputPreservation = is_array($shopPrompt['current_input_preservation'] ?? null) ? $shopPrompt['current_input_preservation'] : [];
|
||||
$currentInputPreservation = is_array($queryCleanup['current_input_preservation'] ?? null) ? $queryCleanup['current_input_preservation'] : [];
|
||||
if (array_key_exists('enabled', $currentInputPreservation) && !is_bool($currentInputPreservation['enabled'])) {
|
||||
$errors[] = 'agent.shop_prompt.current_input_preservation.enabled must be boolean.';
|
||||
$errors[] = 'agent.shop_runtime.query_cleanup.current_input_preservation.enabled must be boolean.';
|
||||
}
|
||||
$this->validateStringList(
|
||||
$this->toList($currentInputPreservation['terms'] ?? []),
|
||||
'agent.shop_prompt.current_input_preservation.terms',
|
||||
'agent.shop_runtime.query_cleanup.current_input_preservation.terms',
|
||||
$errors,
|
||||
$warnings
|
||||
);
|
||||
@@ -1359,17 +1429,20 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
$errors[] = 'agent.input_normalization.prompt.current_user_input_label must not be empty.';
|
||||
}
|
||||
|
||||
$contextUsage = $agent['shop_query_optimizer']['context_usage'] ?? [];
|
||||
$shopRuntime = is_array($agent['shop_runtime'] ?? null) ? $agent['shop_runtime'] : [];
|
||||
$contextResolution = is_array($shopRuntime['context_resolution'] ?? null) ? $shopRuntime['context_resolution'] : [];
|
||||
|
||||
$contextUsage = $contextResolution['context_usage'] ?? [];
|
||||
if (is_array($contextUsage)) {
|
||||
$this->validateStringList($this->toList($contextUsage['referential_terms'] ?? []), 'agent.shop_query_optimizer.context_usage.referential_terms', $errors, $warnings);
|
||||
$this->validateStringList($this->toList($contextUsage['referential_terms'] ?? []), 'agent.shop_runtime.context_resolution.context_usage.referential_terms', $errors, $warnings);
|
||||
}
|
||||
|
||||
$anchorEnrichment = $agent['shop_query_optimizer']['context_anchor_enrichment'] ?? [];
|
||||
$anchorEnrichment = $contextResolution['history_anchor_enrichment'] ?? [];
|
||||
if (is_array($anchorEnrichment)) {
|
||||
$this->validateStringList($this->toList($anchorEnrichment['trigger_terms'] ?? []), 'agent.shop_query_optimizer.context_anchor_enrichment.trigger_terms', $errors, $warnings);
|
||||
$this->validateRegexPatternList($anchorEnrichment['anchor_patterns'] ?? [], 'agent.shop_query_optimizer.context_anchor_enrichment.anchor_patterns', $errors);
|
||||
$this->validateStringList($this->toList($anchorEnrichment['trigger_terms'] ?? []), 'agent.shop_runtime.context_resolution.history_anchor_enrichment.trigger_terms', $errors, $warnings);
|
||||
$this->validateRegexPatternList($anchorEnrichment['anchor_patterns'] ?? [], 'agent.shop_runtime.context_resolution.history_anchor_enrichment.anchor_patterns', $errors);
|
||||
if (trim((string) ($anchorEnrichment['template'] ?? '')) === '') {
|
||||
$errors[] = 'agent.shop_query_optimizer.context_anchor_enrichment.template must not be empty.';
|
||||
$errors[] = 'agent.shop_runtime.context_resolution.history_anchor_enrichment.template must not be empty.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user