Repository navigation
refactor(config): a default that backs a settings field is read only through the settings - #2561
Merged
Merged
Conversation
…through the settings A `DEFAULT_*` value that a settings field takes as its default was also imported at 40 places in 27 modules outside `config/`. Each place read the default by its name, and seven of them ignored a setting that a config file or a variable sets: the RAG chunk size and overlap, the defaults of `devops ai rag search` and of the `rag_search` tool, the sampling that group analysis records, the audit log destination check, the GitHub identity cache directory, the roadmap Service state directory and the OSV snapshot digest directory. Each place now reads the loaded setting, or `setting_default(key)`, the default that the field declares, where no settings are loaded. A class that holds a setting reads the loaded settings when its caller gives no value. An invariant finds every read of a setting's default outside `config/`, with the names derived from the settings module.
Owner
Author
|
Test evidence:
Filed during the work: #2559 ( When this pull request merges, #1000 has all three parts: #2444, #2445 and #2447. Pending a person: review the diff in tuicr ( |
dan-petty
marked this pull request as ready for review
October 28, 2026 23:20
11 tasks
dan-petty
pushed a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- ## [0.12.0](v0.11.3...v0.12.0) (2026-10-29) ### Features * **ai:** constrain structured replies on the openai and claude providers ([#2550](#2550)) ([4f7390a](4f7390a)) * **argo:** retire the Helm release records of the charts that Argo CD renders ([#2568](#2568)) ([cabfcd4](cabfcd4)) * **k8s:** devops k8s tunnel keeps the cloudflared forward to k8s.<domain> running ([#2567](#2567)) ([f9493fa](f9493fa)), closes [#1641](#1641) * **monitoring:** alert when the otel collector fails to export spans, metric points or log records ([#2565](#2565)) ([4fc8ff7](4fc8ff7)) * **telemetry:** the roadmap Service counts its GitHub writes, budget holds, Firecrawl searches and own deliveries, and caps refine's comments on one item ([#2556](#2556)) ([9819877](9819877)), closes [#2475](#2475) ### Bug Fixes * **git:** report a worktree that a run in parallel removed as removed, not a failed reclaim ([#2557](#2557)) ([a556984](a556984)), closes [#2408](#2408) * **k8s:** the devops perimeter opens only the collector's OTLP/HTTP port, 4318 ([#2549](#2549)) ([d156ce7](d156ce7)) * **sandbox:** devops sandbox logs reads each line with its stream from a real engine ([#2546](#2546)) ([e7216d5](e7216d5)), closes [#2520](#2520) * **service:** the webhook route refuses an unsigned or oversized delivery before it reads the body, and a rate limit guards it ([#2553](#2553)) ([40efcd4](40efcd4)), closes [#2476](#2476) ### Performance Improvements * **ai:** price a request with one load of the settings ([#2555](#2555)) ([5d86538](5d86538)), closes [#1420](#1420) ### Code Refactoring * **config:** a default that backs a settings field is read only through the settings ([#2561](#2561)) ([0702d13](0702d13)) * **exceptions:** each exception class declares its error_code and exit_code ([#2558](#2558)) ([410dece](410dece)) * **review:** render the review report from one input, outside the orchestrator ([#2563](#2563)) ([9e73e6d](9e73e6d)), closes [#1008](#1008) * **security:** src has no unreviewed Bandit findings, and the gate scans src at low severity ([#2560](#2560)) ([45261dd](45261dd)), closes [#1538](#1538) * **security:** the scanners stop looking for mocks, and their tests run on the scanner fake ([#2551](#2551)) ([2b7f37a](2b7f37a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
DEFAULT_*value that a settings field takes as its default was also imported at 40 places in 27 modules outsideconfig/. A module that reads the default by its name does not see a config file or a variable that sets the setting. Seven places ignored such a setting:SemanticChunker, and so the workspace indexer and the code-retrieval benchmark, never readai.rag.chunk_sizeorai.rag.chunk_overlap.devops ai rag searchgave--top-kand--min-scorethe defaults, soai.rag.top_kandai.rag.score_thresholddid not apply. Therag_searchtool gave the retriever no score threshold.ai.temperatureandai.top_pas its sampling, while theanalysistask's client sendsai.tasks.analysis.DEVOPS_CLI_AUDIT_LOG_DESTonly in.dataof the working directory or inDEVOPS_CLI_DATA_DIR, not indata.dirof the config file.data.diranddata.cache_dirof the config file, and fell back to.dataof the working directory.What changes:
setting_default(key)inconfig/settings.pygives the default that a field declares. A module reads it only where no settings are loaded.SemanticChunker,WorkspaceIndexer,SemanticRetriever,QdrantClient(qdrant.timeout),ValkeyClient(valkey.timeout) andLLMResponseCache.acquire_ollama_slot,track_ollama_urlandQdrantClient.search_pointstakemax_parallelandlimitfrom their callers, which pass the settings.devops ai rag searchresolves--top-kand--min-scorefromai.ragbefore its dry run, and its help names the settings.run_group_analysiswith no sampling records theanalysistask's sampling (configured_sampling()).data.dirordata.cache_dirof the loaded settings withresolve_data_path. The GitHub cache root is read once for each process, andreset_github_rate_limiterreads it again.setting_default. The AIBOM hardware estimate names its own context window. The spend report gets its reference models from the ledger only._resolve_llm_cacheloses its copies of the cache defaults.tests/invariants/test_source_tree.pyfinds each read of a setting's default outsideconfig/. It derives the names from the settings module, so it keeps no list and no baseline.CONTRIBUTING.mdstates the rule.Closes #2447
Change:
openspec/changes/archive/2026-10-28-2447-settings-defaults-boundary/