What happened
DomainAwarePolicies and the four policy types it inlines are declared but embedded in nothing, so the
13 yaml keys they define are never parsed from any config. Six of those keys are set in configs in this
repo, including per-category tuning in bench/.
src/semantic-router/pkg/config/signal_config.go:298:
type DomainAwarePolicies struct {
SystemPromptPolicy `yaml:",inline"`
SemanticCachingPolicy `yaml:",inline"`
JailbreakPolicy `yaml:",inline"`
PIIDetectionPolicy `yaml:",inline"`
}
Repo-wide, non-test, excluding the declaration itself:
| type |
references |
DomainAwarePolicies |
0 |
SystemPromptPolicy |
0 |
SemanticCachingPolicy |
0 |
JailbreakPolicy |
0 |
PIIDetectionPolicy |
0 |
Nothing in src/semantic-router, deploy/operator or the dashboard embeds or reads them, and each of
these yaml keys is defined on exactly one Go field, so there is no second, reachable struct picking them up.
Where it already bites
bench/cpu-vs-gpu/config-bench-candle.yaml sets per-category caching policy 6 times:
- name: psychology
system_prompt: You are a psychology expert with deep knowledge of ...
semantic_cache_enabled: true
semantic_cache_similarity_threshold: 0.92
with 0.75, 0.92 and 0.95 used across categories. All of it is dropped, so the benchmark runs every
category on the same global cache settings rather than the per-category ones it declares.
system_prompt on the sibling line is honoured (it is a field on a reachable struct), which is what
makes this hard to spot: adjacent keys in the same block behave differently.
Affected keys
system_prompt_enabled, system_prompt_mode, semantic_cache_enabled,
semantic_cache_similarity_threshold, jailbreak_enabled, jailbreak_threshold, pii_enabled,
pii_threshold.
jailbreak_threshold and pii_threshold are the ones I would prioritise. An operator tightening a
jailbreak or PII threshold for a specific domain currently gets the global value with no warning.
Note on the unknown-field linter
WarnUnknownFields does not flag these, so they are silent at startup too. That is consistent with the
blind spot I reported on #2469: the collector does not appear to reach this level of the tree.
Fix
Two directions and I don't want to pick for you:
- Wire it up. Embed
DomainAwarePolicies where per-category policy is resolved and honour the
thresholds. This is feature work and needs a decision on precedence against the global values.
- Remove it. Delete the orphaned types and the keys from
bench/. Behaviour-neutral, but it
removes surface the bench configs are already written against.
Happy to send either. Found while working on #2767/#2769.
What happened
DomainAwarePoliciesand the four policy types it inlines are declared but embedded in nothing, so the13 yaml keys they define are never parsed from any config. Six of those keys are set in configs in this
repo, including per-category tuning in
bench/.src/semantic-router/pkg/config/signal_config.go:298:Repo-wide, non-test, excluding the declaration itself:
DomainAwarePoliciesSystemPromptPolicySemanticCachingPolicyJailbreakPolicyPIIDetectionPolicyNothing in
src/semantic-router,deploy/operatoror the dashboard embeds or reads them, and each ofthese yaml keys is defined on exactly one Go field, so there is no second, reachable struct picking them up.
Where it already bites
bench/cpu-vs-gpu/config-bench-candle.yamlsets per-category caching policy 6 times:with 0.75, 0.92 and 0.95 used across categories. All of it is dropped, so the benchmark runs every
category on the same global cache settings rather than the per-category ones it declares.
system_prompton the sibling line is honoured (it is a field on a reachable struct), which is whatmakes this hard to spot: adjacent keys in the same block behave differently.
Affected keys
system_prompt_enabled,system_prompt_mode,semantic_cache_enabled,semantic_cache_similarity_threshold,jailbreak_enabled,jailbreak_threshold,pii_enabled,pii_threshold.jailbreak_thresholdandpii_thresholdare the ones I would prioritise. An operator tightening ajailbreak or PII threshold for a specific domain currently gets the global value with no warning.
Note on the unknown-field linter
WarnUnknownFieldsdoes not flag these, so they are silent at startup too. That is consistent with theblind spot I reported on #2469: the collector does not appear to reach this level of the tree.
Fix
Two directions and I don't want to pick for you:
DomainAwarePolicieswhere per-category policy is resolved and honour thethresholds. This is feature work and needs a decision on precedence against the global values.
bench/. Behaviour-neutral, but itremoves surface the bench configs are already written against.
Happy to send either. Found while working on #2767/#2769.