This commit is contained in:
team 1
2026-05-06 16:02:42 +02:00
parent e02c885527
commit abe929bd20
5 changed files with 515 additions and 349 deletions

View File

@@ -749,37 +749,37 @@ final class AgentRunnerConfig
public function isDirectShopResultAnswerEnabled(): bool
{
return $this->getRequiredBool('direct_shop_result_answer.enabled');
return $this->getRequiredBool('shop_runtime.direct_answer.enabled');
}
public function getDirectShopResultAnswerMaxResults(): int
{
return $this->getRequiredInt('direct_shop_result_answer.max_results');
return $this->getRequiredInt('shop_runtime.direct_answer.max_results');
}
public function getDirectShopResultAnswerIntro(): string
{
return $this->getRequiredString('direct_shop_result_answer.intro');
return $this->getRequiredString('shop_runtime.direct_answer.intro');
}
public function getDirectShopResultAnswerNoResultsMessage(): string
{
return $this->getRequiredString('direct_shop_result_answer.no_results');
return $this->getRequiredString('shop_runtime.direct_answer.no_results');
}
public function getDirectShopResultAnswerSortedByLengthNote(): string
{
return $this->getRequiredString('direct_shop_result_answer.sorted_by_length_note');
return $this->getRequiredString('shop_runtime.direct_answer.sorted_by_length_note');
}
public function getDirectShopResultAnswerMinLengthFilterNote(): string
{
return $this->getRequiredString('direct_shop_result_answer.min_length_filter_note');
return $this->getRequiredString('shop_runtime.direct_answer.min_length_filter_note');
}
public function getDirectShopResultAnswerMaxLengthFilterNote(): string
{
return $this->getRequiredString('direct_shop_result_answer.max_length_filter_note');
return $this->getRequiredString('shop_runtime.direct_answer.max_length_filter_note');
}
public function getNoLlmFallbackMaxShopResults(): int
@@ -1073,12 +1073,12 @@ final class AgentRunnerConfig
*/
public function getShopQueryContextUsageReferentialTerms(): array
{
return $this->getRequiredStringList('shop_prompt.context_usage.referential_terms');
return $this->getRequiredStringList('shop_runtime.context_resolution.context_usage.referential_terms');
}
public function isShopQueryCurrentInputPreservationEnabled(): bool
{
return $this->getOptionalBool('shop_prompt.current_input_preservation.enabled', true);
return $this->getOptionalBool('shop_runtime.query_cleanup.current_input_preservation.enabled', true);
}
/**
@@ -1087,19 +1087,19 @@ final class AgentRunnerConfig
public function getShopQueryCurrentInputPreservationTerms(): array
{
return $this->getConfiguredStringListOrVocabularyView(
'shop_prompt.current_input_preservation.terms',
'shop_prompt.current_input_preservation.vocabulary_views.terms'
'shop_runtime.query_cleanup.current_input_preservation.terms',
'shop_runtime.query_cleanup.current_input_preservation.vocabulary_views.terms'
);
}
public function isShopQueryProductAttributeCleanupEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.product_attribute_query_cleanup.enabled');
return $this->getRequiredBool('shop_runtime.attribute_cleanup.enabled');
}
public function getShopQueryProductAttributeCleanupMinTokens(): int
{
return $this->getRequiredInt('shop_prompt.product_attribute_query_cleanup.min_query_tokens_after_cleanup');
return $this->getRequiredInt('shop_runtime.attribute_cleanup.min_query_tokens_after_cleanup');
}
/**
@@ -1108,8 +1108,8 @@ final class AgentRunnerConfig
public function getShopQueryProductAttributeCleanupProductTypeTerms(): array
{
return $this->getConfiguredStringListOrVocabularyView(
'shop_prompt.product_attribute_query_cleanup.product_type_terms',
'shop_prompt.product_attribute_query_cleanup.vocabulary_views.product_type_terms'
'shop_runtime.attribute_cleanup.product_type_terms',
'shop_runtime.attribute_cleanup.vocabulary_views.product_type_terms'
);
}
@@ -1119,8 +1119,8 @@ final class AgentRunnerConfig
public function getShopQueryProductAttributeCleanupStopTerms(): array
{
return $this->getConfiguredStringListOrVocabularyView(
'shop_prompt.product_attribute_query_cleanup.stop_terms',
'shop_prompt.product_attribute_query_cleanup.vocabulary_views.stop_terms'
'shop_runtime.attribute_cleanup.stop_terms',
'shop_runtime.attribute_cleanup.vocabulary_views.stop_terms'
);
}
@@ -1129,17 +1129,17 @@ final class AgentRunnerConfig
*/
public function getShopQueryProductAttributeCleanupComparativeConstraintPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.product_attribute_query_cleanup.comparative_constraint_patterns');
return $this->getRequiredStringList('shop_runtime.attribute_cleanup.comparative_constraint_patterns');
}
public function isShopQueryStopwordCleanupEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.query_stopword_cleanup.enabled');
return $this->getRequiredBool('shop_runtime.query_cleanup.stopword_cleanup.enabled');
}
public function getShopQueryStopwordCleanupMinTokens(): int
{
return $this->getRequiredInt('shop_prompt.query_stopword_cleanup.min_query_tokens_after_cleanup');
return $this->getRequiredInt('shop_runtime.query_cleanup.stopword_cleanup.min_query_tokens_after_cleanup');
}
/**
@@ -1147,22 +1147,22 @@ final class AgentRunnerConfig
*/
public function getShopQueryStopwordCleanupTerms(): array
{
return $this->getRequiredStringList('shop_prompt.query_stopword_cleanup.terms');
return $this->getRequiredStringList('shop_runtime.query_cleanup.stopword_cleanup.terms');
}
public function isDirectShopResultGuardEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.direct_result_guard.enabled');
return $this->getRequiredBool('shop_runtime.result_identity.enabled');
}
public function shouldPreferDirectShopResultGuardPrimaryIdentityMatches(): bool
{
return $this->getOptionalBool('shop_prompt.direct_result_guard.prefer_primary_identity_matches', true);
return $this->getOptionalBool('shop_runtime.result_identity.prefer_primary_identity_matches', true);
}
public function isDirectShopResultGuardCompoundPrefixMatchEnabled(): bool
{
return $this->getOptionalBool('shop_prompt.direct_result_guard.compound_prefix_match.enabled', false);
return $this->getOptionalBool('shop_runtime.result_identity.compound_prefix_match.enabled', false);
}
/**
@@ -1170,17 +1170,17 @@ final class AgentRunnerConfig
*/
public function getDirectShopResultGuardCompoundPrefixTerms(): array
{
return $this->getOptionalStringList('shop_prompt.direct_result_guard.compound_prefix_match.terms');
return $this->getOptionalStringList('shop_runtime.result_identity.compound_prefix_match.terms');
}
public function isDirectShopResultGuardPrimaryIdentityRepairEnabled(): bool
{
return $this->getOptionalBool('shop_prompt.direct_result_guard.primary_identity_repair.enabled', true);
return $this->getOptionalBool('shop_runtime.result_identity.primary_identity_repair.enabled', true);
}
public function getDirectShopResultGuardPrimaryIdentityRepairMinQueryTokens(): int
{
return $this->getOptionalInt('shop_prompt.direct_result_guard.primary_identity_repair.min_query_tokens_after_cleanup', 2);
return $this->getOptionalInt('shop_runtime.result_identity.primary_identity_repair.min_query_tokens_after_cleanup', 2);
}
/**
@@ -1188,12 +1188,12 @@ final class AgentRunnerConfig
*/
public function getDirectShopResultGuardPrimaryIdentityRepairStopTerms(): array
{
return $this->getOptionalStringList('shop_prompt.direct_result_guard.primary_identity_repair.stop_terms');
return $this->getOptionalStringList('shop_runtime.result_identity.primary_identity_repair.stop_terms');
}
public function isShopResultLengthSortEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.length_sort.enabled');
return $this->getRequiredBool('shop_runtime.answer_constraints.length_sort.enabled');
}
/**
@@ -1201,7 +1201,7 @@ final class AgentRunnerConfig
*/
public function getShopResultLengthSortTriggerPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.length_sort.trigger_patterns');
return $this->getRequiredStringList('shop_runtime.answer_constraints.length_sort.trigger_patterns');
}
/**
@@ -1209,12 +1209,12 @@ final class AgentRunnerConfig
*/
public function getShopResultLengthSortValuePatterns(): array
{
return $this->getRequiredStringList('shop_prompt.length_sort.value_patterns');
return $this->getRequiredStringList('shop_runtime.answer_constraints.length_sort.value_patterns');
}
public function isShopResultLengthFilterEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.length_filter.enabled');
return $this->getRequiredBool('shop_runtime.answer_constraints.length_filter.enabled');
}
/**
@@ -1222,7 +1222,7 @@ final class AgentRunnerConfig
*/
public function getShopResultMinLengthFilterPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.length_filter.min_patterns');
return $this->getRequiredStringList('shop_runtime.answer_constraints.length_filter.min_patterns');
}
/**
@@ -1230,7 +1230,7 @@ final class AgentRunnerConfig
*/
public function getShopResultMaxLengthFilterPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.length_filter.max_patterns');
return $this->getRequiredStringList('shop_runtime.answer_constraints.length_filter.max_patterns');
}
public function getShopPromptIntro(): string
@@ -1304,12 +1304,12 @@ final class AgentRunnerConfig
public function isShopQueryMetaGuardEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.meta_query_guard.enabled');
return $this->getRequiredBool('shop_runtime.context_resolution.meta_query_guard.enabled');
}
public function getShopQueryContextFallbackCleanupProfile(): string
{
$value = $this->optionalValue('shop_prompt.meta_query_guard.cleanup_profile');
$value = $this->optionalValue('shop_runtime.context_resolution.meta_query_guard.cleanup_profile');
if (is_string($value) && trim($value) !== '') {
return trim($value);
@@ -1323,32 +1323,32 @@ final class AgentRunnerConfig
*/
public function getShopQueryMetaOnlyTerms(): array
{
return $this->getRequiredStringList('shop_prompt.meta_query_guard.meta_only_terms');
return $this->getRequiredStringList('shop_runtime.context_resolution.meta_query_guard.meta_only_terms');
}
public function isShopQueryContextFallbackEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.meta_query_guard.context_fallback_enabled');
return $this->getRequiredBool('shop_runtime.context_resolution.meta_query_guard.context_fallback_enabled');
}
public function getShopQueryContextFallbackQuestionLimit(): int
{
return $this->getRequiredInt('shop_prompt.meta_query_guard.context_fallback_question_limit');
return $this->getRequiredInt('shop_runtime.context_resolution.meta_query_guard.context_fallback_question_limit');
}
public function getShopQueryContextFallbackHistoryBudgetChars(): int
{
return $this->getRequiredInt('shop_prompt.meta_query_guard.context_fallback_history_budget_chars');
return $this->getRequiredInt('shop_runtime.context_resolution.meta_query_guard.context_fallback_history_budget_chars');
}
public function shouldUseFullHistoryForShopQueryContextFallback(): bool
{
return $this->getRequiredBool('shop_prompt.meta_query_guard.context_fallback_use_full_history');
return $this->getRequiredBool('shop_runtime.context_resolution.meta_query_guard.context_fallback_use_full_history');
}
public function getShopQueryContextFallbackMaxTerms(): int
{
return $this->getRequiredInt('shop_prompt.meta_query_guard.context_fallback_max_terms');
return $this->getRequiredInt('shop_runtime.context_resolution.meta_query_guard.context_fallback_max_terms');
}
/**
@@ -1356,17 +1356,17 @@ final class AgentRunnerConfig
*/
public function getShopQueryContextFallbackFilterTerms(): array
{
return $this->getRequiredStringList('shop_prompt.meta_query_guard.context_fallback_filter_terms');
return $this->getRequiredStringList('shop_runtime.context_resolution.meta_query_guard.context_fallback_filter_terms');
}
public function isShopQueryContextAnchorEnrichmentEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.context_anchor_enrichment.enabled');
return $this->getRequiredBool('shop_runtime.context_resolution.history_anchor_enrichment.enabled');
}
public function getShopQueryContextAnchorEnrichmentMaxQueryTerms(): int
{
return $this->getRequiredInt('shop_prompt.context_anchor_enrichment.max_query_terms');
return $this->getRequiredInt('shop_runtime.context_resolution.history_anchor_enrichment.max_query_terms');
}
/**
@@ -1375,8 +1375,8 @@ final class AgentRunnerConfig
public function getShopQueryContextAnchorEnrichmentTriggerTerms(): array
{
return $this->getConfiguredStringListOrVocabularyView(
'shop_prompt.context_anchor_enrichment.trigger_terms',
'shop_prompt.context_anchor_enrichment.vocabulary_views.trigger_terms'
'shop_runtime.context_resolution.history_anchor_enrichment.trigger_terms',
'shop_runtime.context_resolution.history_anchor_enrichment.vocabulary_views.trigger_terms'
);
}
@@ -1385,51 +1385,51 @@ final class AgentRunnerConfig
*/
public function getShopQueryContextAnchorEnrichmentPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.context_anchor_enrichment.anchor_patterns');
return $this->getRequiredStringList('shop_runtime.context_resolution.history_anchor_enrichment.anchor_patterns');
}
public function getShopQueryContextAnchorEnrichmentTemplate(): string
{
return $this->getRequiredString('shop_prompt.context_anchor_enrichment.template');
return $this->getRequiredString('shop_runtime.context_resolution.history_anchor_enrichment.template');
}
public function isShopQueryRagAnchorEnrichmentEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.rag_anchor_enrichment.enabled');
return $this->getRequiredBool('shop_runtime.context_resolution.rag_anchor_enrichment.enabled');
}
public function getShopQueryRagAnchorEnrichmentMinScore(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.min_score');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.min_score');
}
public function getShopQueryRagAnchorEnrichmentMaxQueryTerms(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.max_query_terms');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.max_query_terms');
}
public function getShopQueryRagAnchorEnrichmentEarlyChunkBonusMax(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.early_chunk_bonus_max');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.early_chunk_bonus_max');
}
public function getShopQueryRagAnchorEnrichmentExactValueUnitScore(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.exact_value_with_unit');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.scores.exact_value_with_unit');
}
public function getShopQueryRagAnchorEnrichmentExactValueScore(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.exact_value_only');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.scores.exact_value_only');
}
public function getShopQueryRagAnchorEnrichmentAnchorBonusScore(): int
{
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.anchor_bonus');
return $this->getRequiredInt('shop_runtime.context_resolution.rag_anchor_enrichment.scores.anchor_bonus');
}
public function getShopQueryRagAnchorEnrichmentTemplate(): string
{
return $this->getRequiredString('shop_prompt.rag_anchor_enrichment.template');
return $this->getRequiredString('shop_runtime.context_resolution.rag_anchor_enrichment.template');
}
/**
@@ -1437,7 +1437,7 @@ final class AgentRunnerConfig
*/
public function getShopQueryRagAnchorEnrichmentNumericFocusPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.numeric_focus_patterns');
return $this->getRequiredStringList('shop_runtime.context_resolution.rag_anchor_enrichment.numeric_focus_patterns');
}
/**
@@ -1445,7 +1445,7 @@ final class AgentRunnerConfig
*/
public function getShopQueryRagAnchorEnrichmentProductTitlePatterns(): array
{
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.product_title_patterns');
return $this->getRequiredStringList('shop_runtime.context_resolution.rag_anchor_enrichment.product_title_patterns');
}
/**
@@ -1453,7 +1453,7 @@ final class AgentRunnerConfig
*/
public function getShopQueryRagAnchorEnrichmentAnchorBonusPatterns(): array
{
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.anchor_bonus_patterns');
return $this->getRequiredStringList('shop_runtime.context_resolution.rag_anchor_enrichment.anchor_bonus_patterns');
}
/**
@@ -1461,7 +1461,7 @@ final class AgentRunnerConfig
*/
public function getShopQueryRagAnchorEnrichmentSubjectTerms(): array
{
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.subject_terms');
return $this->getRequiredStringList('shop_runtime.context_resolution.rag_anchor_enrichment.subject_terms');
}
public function getShopQueryTranslationReplacements(string $language): array

View File

@@ -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.';
}
}
}