Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs(settings): state the trusted-vs-untrusted rationale in validate_imported_setting_value's docstring (#6900)

LearningCircuit6e88a356fd59
diff --git a/src/local_deep_research/settings/manager.py b/src/local_deep_research/settings/manager.py
index 24e6d0ec5d..ac0b57ae6e 100644
--- a/src/local_deep_research/settings/manager.py
+++ b/src/local_deep_research/settings/manager.py
@@ -205,6 +205,25 @@ def validate_imported_setting_value(
cannot resurrect values that are invalid under the current schema
(#5589).
+ Trusted-vs-untrusted rationale (the call-site comments in both
+ managers' ``import_settings`` point here): file-supplied values are
+ new input, so ``import_settings`` runs this check on them (keys with
+ no defaults metadata, and in-memory entries without a ``value``
+ field, are stored unchecked). Retained database or in-memory values
+ — kept through ``overwrite=False`` or
+ ``preserve_environment_locked=True`` to preserve existing user data
+ — are not new input and deliberately skip this check. Re-validating
+ them would not discard them: on a reject, both managers keep the
+ key's existing row or entry, as they do for a rejected file value.
+ It would cost the key's metadata refresh instead: where retained
+ keys get refreshed metadata (the database manager, and env-locked
+ keys in the in-memory one), a key whose stored value fails the
+ current rules would keep its previous metadata (``ui_element``,
+ options, min/max). "Trusted" in the call-site comments refers to this
+ preservation decision; it does not imply prior schema validation.
+ Programmatic setters can bypass this check, and older values may
+ not satisfy the current defaults schema.
+
Returns ``None`` when the value is acceptable, or a human-readable
reason string when it is not.
"""