Skip to content

fix(config): read an empty excludeCategories list as dropping no category - #289

Merged
goldbarth merged 1 commit into
mainfrom
fix/empty-list-setting
Sep 30, 2026
Merged

goldbarth merged 1 commit into
mainfrom
fix/empty-list-setting

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Closes #277

  • Why: filter.excludeCategories: [] is meant to drop no category, and was read as no setting, so the default [Internal] stayed in force. ChangeFilterRules and FilterOptions both document that an empty list replaces the default; the file never got that far.
  • Two places lost it, not one: Flatten turned an empty sequence into no key, as the issue says. Behind it, ChartulaConfiguration.Build layers the settings with AddConfiguration, whose provider passes an empty value on as no value. A unit test on Flatten alone passed while the run still kept [Internal]; the end-to-end run below found the second one.
  • An empty list is read as the value []: the YAML spelling of an empty list, and a value the layering keeps. Rebuilding the layering to keep empty values instead would change what an empty Chartula__ variable means today (no setting), for every key.
  • Only excludeCategories reads it: the binder leaves an empty list null, and this is the one list whose default differs from empty. categories.order: [] already falls back to the default order in CategorySettings, and the labels.* lists default to empty. Both were checked with [] in the run below.
  • Honored, not refused: the issue allowed either. Keeping internal work is a legitimate choice, and without [] there is no way to express it.
  • Chartula__Filter__ExcludeCategories=[] works the same way, for a run without a list in the file.
  • docs/configuration.md states the behavior (roadmap follow-up 2.7, the An empty list in chartula.yaml is read as no setting, so excludeCategories: [] keeps [Internal] #277 part).

Reproduced and verified end to end, preview --tag v0.1.0-preview.3 --audience technical, model pointed at a closed port so no token is spent. The range holds 7 pull requests, one of them build: (Internal):

default                                  7 pull requests, 6 facts
excludeCategories: [], on main           7 pull requests, 6 facts
excludeCategories: [], this branch       7 pull requests, 7 facts
  plus order: [] and labels.internal: [] 7 pull requests, 7 facts
Chartula__Filter__ExcludeCategories=[]   7 pull requests, 7 facts
excludeCategories: [Documentation]       7 pull requests, 5 facts

Tests: FilterWiringTests (no list and excludeCategories: keep the default, [] in the file and in the environment drops nothing, a list replaces the default), built through ChartulaConfiguration.Build so the layering is covered; ChartulaYamlConfigurationTests.An_empty_list_is_kept_as_a_value_of_its_own. Full suite passing, build without warnings, dotnet format clean.

@goldbarth goldbarth self-assigned this Sep 30, 2026
@goldbarth
goldbarth merged commit 885c7f7 into main Sep 30, 2026
4 checks passed
@goldbarth
goldbarth deleted the fix/empty-list-setting branch September 30, 2026 11:42
goldbarth added a commit that referenced this pull request Oct 1, 2026
…320)

Follows #319 (ADR 0004); this branch builds on it for the index row and
is rebased onto `main` once #319 is merged.

- **Why:** seven changes since September made Chartula stop where it
used to choose silently, each with its own reasoning in its pull
request, but the rule they share was written down nowhere. A contributor
adding an option or a setting could not tell whether to refuse an
ambiguous value or take the likelier reading, nor when refusing goes too
far.
- **Context** lists the seven cases in one table, each with what the
silent choice did and the change that ended it: a first tag (#198 for
#138, #282), a key sent to the other provider's host (#235), an unknown
or misindented key (#238), a shallow clone read as a first release
(#244), review mode approving unseen text (#247), two configuration
files (#287 for #278), and options a command does not take (#301).
Decided is #198, the first of them.
- **Decision:** stop and say so instead of choosing; before anything is
spent; with a message that names the cause and the fix, shown with two
real messages; ask at a terminal where the answer is the user's, and
stop naming the option without one; refuse only what Chartula can tell
for certain (an empty list, an unknown host and an unknown model id are
taken as written); refuse a setting that would have no effect. The rule
is about what the user meant, not about what the release says, which is
what flags are for.
- **Consequences** name the cost: a run that could have produced
something stops, and a CI job fails until the input says what it means.
The ADR weighs that rerun against what a silent choice cost in the seven
cases. For a new case, four questions in order, so a contributor can
apply the rule rather than match it against the examples.
- The index in `adr/README.md` lists 0005.

**Verified:**
- Each case was checked against its pull request's description and the
issue it closes (#237, #243, #233, #278, #300, #138); the dates are the
merge dates.
- Both messages are the ones `docs/cli.md` and `docs/configuration.md`
show from the built binary.
- The counter-cases were checked in the code: `ProviderHost` accepts
every host but two, `ClaudeThinkingSupport` passes an unknown model id,
#289 reads an empty list as written, and #244 still runs `--since` in a
shallow clone when the range holds.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none, documentation only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An empty list in chartula.yaml is read as no setting, so excludeCategories: [] keeps [Internal]

1 participant