Context
The semantic cache plugin accepts hallucination-control settings (strictness level, temperature cap, technique list) but does not validate them at startup. Invalid values are silently coerced to defaults (see hallucControlStrictness() at line ~65), which can mask operator configuration mistakes.
What to do
- Add a validation function (in
main.go or a new validation.go):
func validateHallucinationControlConfig(config *Config) error
checking:
- Strictness is one of
"low", "medium", "high".
- Temperature cap is within a sensible range (
0.0-2.0).
- Every entry in the techniques list is a known technique ID:
grounding_directive, anti_fabrication, citation_required, uncertainty_ack, temperature_clamp.
- Return a descriptive error naming the offending field and the allowed values.
- Call the validator during the plugin's Init/Setup flow so misconfiguration fails fast instead of being silently normalized.
Acceptance criteria
File pointers
- Config struct + getters:
deepintshield_server/plugins/semanticcache/main.go (hallucControlStrictness:65, hallucControlTempCap:78, hallucControlTechniques:92)
- Technique IDs:
deepintshield_server/plugins/semanticcache/hallucination_control.go (constants near lines 18-31)
Context
The semantic cache plugin accepts hallucination-control settings (strictness level, temperature cap, technique list) but does not validate them at startup. Invalid values are silently coerced to defaults (see
hallucControlStrictness()at line ~65), which can mask operator configuration mistakes.What to do
main.goor a newvalidation.go):"low","medium","high".0.0-2.0).grounding_directive,anti_fabrication,citation_required,uncertainty_ack,temperature_clamp.Acceptance criteria
"invalid"), out-of-range temp cap (e.g.-1.0,100.0), and unknown technique IDs each produce a clear validation error.go test ./plugins/semanticcache/...passes.File pointers
deepintshield_server/plugins/semanticcache/main.go(hallucControlStrictness:65, hallucControlTempCap:78, hallucControlTechniques:92)deepintshield_server/plugins/semanticcache/hallucination_control.go(constants near lines 18-31)