Summary
The configuration merge pipeline in src/cli/merge.rs silently accumulates errors and makes no observability available to operators trying to diagnose configuration failures. Adding structured debug logging at each layer boundary would make the merge process auditable.
Context
PR #273 introduced merge_with_config and resolve_merged_diag_json in src/cli/merge.rs. The pipeline traverses four layers (defaults, file, environment, CLI) but emits no log output at discovery or merge time.
Proposed work
- Add
tracing::debug! calls in merge_with_config for each layer push (defaults applied, file discovered, environment merged, CLI overrides applied)
- Log config file discovery attempts (path tried, found/not found)
- Log validation rejections with structured fields (key, reason)
- Ensure log output is suppressed when
diag_json mode is active (to avoid polluting machine-readable output)
Backlinks
Rescope (2026-08-12)
The discovery half of this work has landed: src/cli/discovery.rs now uses tracing::{debug, debug_span} (emissions at lines 101 and 168) with a dedicated src/cli/discovery_tracing_tests.rs. Remaining scope: src/cli/merge.rs itself still has zero tracing calls — no per-layer logging in merge_with_config (defaults / file / env / CLI) and no structured validation-rejection logging. Note also the rename since filing: resolve_merged_diag_json is now resolve_merged_json, and "diag_json mode" is now the --json flag.
Summary
The configuration merge pipeline in
src/cli/merge.rssilently accumulates errors and makes no observability available to operators trying to diagnose configuration failures. Adding structured debug logging at each layer boundary would make the merge process auditable.Context
PR #273 introduced
merge_with_configandresolve_merged_diag_jsoninsrc/cli/merge.rs. The pipeline traverses four layers (defaults, file, environment, CLI) but emits no log output at discovery or merge time.Proposed work
tracing::debug!calls inmerge_with_configfor each layer push (defaults applied, file discovered, environment merged, CLI overrides applied)diag_jsonmode is active (to avoid polluting machine-readable output)Backlinks
Rescope (2026-08-12)
The discovery half of this work has landed:
src/cli/discovery.rsnow usestracing::{debug, debug_span}(emissions at lines 101 and 168) with a dedicatedsrc/cli/discovery_tracing_tests.rs. Remaining scope:src/cli/merge.rsitself still has zero tracing calls — no per-layer logging inmerge_with_config(defaults / file / env / CLI) and no structured validation-rejection logging. Note also the rename since filing:resolve_merged_diag_jsonis nowresolve_merged_json, and "diag_json mode" is now the--jsonflag.