fix(config): report uncompilable stored index patterns - #2728
Merged
Merged
Conversation
Releases through v1.0.0-beta.63 stored index.exclude.v1 and index.include.v1 patterns without compiling them. The runtime pin dropped such a pattern behind a process-deduplicated tracing::warn!, so a broken exclude silently widened what gets indexed. A stored pattern that does not compile is now a typed setting finding. ConfigurationGet returns it in ResolvedSetting.findings with the pattern, the compiler message and the legal actions (set, unset), and `tracedecay doctor` reports it as an issue naming the key and its repair. The pin keeps applying the remaining patterns: the configuration control plane is built on the same pin, so refusing it would also refuse the set/unset that repairs it. New writes of such a pattern stay refused. The WARNED set is deleted.
|
…allowed-errors # Conflicts: # crates/tracedecay/src/doctor.rs
This was referenced Sep 30, 2026
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.
Root cause
Releases through
v1.0.0-beta.63(the published build) storedindex.exclude.v1/index.include.v1patterns without compiling them; #2514 added the compile check to the write path only. When the runtime pin later decoded such a stored pattern,compilable_index_patternsdropped it and logged onetracing::warn!per process (deduplicated through a process-globalWARNEDset). A broken exclude therefore silently widened what gets indexed. The only trace was a log line.What changed
ResolvedSetting(theConfigurationGetresult) gainsfindings: Vec<ConfigurationSettingFindingV1>. A stored index path pattern that does not compile isinvalid_index_path_pattern { pattern, message, legal_actions: [set, unset] }.partition_index_patterns, serves both the runtime pin (applied patterns) andsetting_findings(the typed report). The project and profilegetpaths both callsetting_findings. TheWARNEDset and its log line are deleted.tracedecay doctorreads both index keys for the served current project and reports each finding as an issue naming the key, the pattern, the compiler message and the repair.validate_written_valuenow describes the finding instead of the skip.Why indexing continues without the pattern instead of refusing
The configuration crate's documented rule for a check that tightens across releases (
ConfigurationRegistry::validate_written_value) is to refuse new writes while stored values keep loading. That split exists so read-time validation cannot strand a store. A refusal insidePinnedRuntimeConfiguration::newwould fail project open.ProjectConfigurationRuntime::current()builds the same pin, so that refusal would also take downtracedecay_configuration_set/_unset, the only legal repair. The pin keeps applying the remaining patterns, and the unapplied one is reported as a typed finding through the configuration read and doctor instead of a log line.Fail before / pass after
Test:
config::tests::runtime_configuration_cutover::a_stored_uncompilable_index_pattern_is_a_typed_setting_findingintracedecay-project. It seeds an isolated registered project store the way beta.63 left it (canonical revision with the daemon source binding plusindex.exclude.v1 = ["src/[abc", "docs/**"]), opens it through the productionopen_runtime_configuration_for_registered_databasepath, and reads through the daemon configuration client.With the production changes reverted:
With the fix (after rebasing onto master):
test result: ok. 20 passed; 0 failed(tracedecay-project --lib config::).Runtime journey (the real upgrade path)
Isolated
HOME/TRACEDECAY_DATA_DIR, one daemon at a time undersystemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G.tracedecay 1.0.0-beta.63daemon:tracedecay init, thentracedecay_configuration_set index.exclude.v1 ["src/[abc","docs/**"]→Outcome: effect(accepted unchecked). Daemon stopped.Daemon stopped;
pgrep -af 'tracedecay daemon run'shows none from this lane.Checks
run_doctorconflict with fix(feedback): publish the advisory mount's own typed state #2724 was resolved by keeping master's shape and guarding the new check ondaemon_status == Some(Ok(Some(_)))):cargo test -p tracedecay-project --lib config::: 20 passed (includes the new test)cargo test -p tracedecay --lib doctor::: 50 passedcargo test -p tracedecay-configuration --lib: 37 passed;-p tracedecay-contracts --lib: 432 passedcargo test -p tracedecay-global-db --lib configuration: 46 passed;-p tracedecay-daemon-service --lib configuration: 16 passedcargo clippy -p tracedecay-contracts -p tracedecay-configuration -p tracedecay-global-db -p tracedecay-daemon-service -p tracedecay-project -p tracedecay --all-targets -- -D warnings: cleancargo fmt --all -- --check: clean;pnpm --dir dashboard run contracts:check: contracts up to dateripwire --quality-delta=HEAD: gating=0Follow-ups outside this PR
code_index_scheduler/reconcile.rsandregistry.rs, which other lanes own, plus a naming decision: code-index: unrepresentable Git paths vanish from the snapshot while status reports complete #2721.configuration_read_from_pinindoctor_kernel.rs, owned by the doctor lane) still reportsconfiguration.resolved.in-syncfor a pin with unapplied patterns. It could readsetting_findingsto report partial coverage.