A misspelled or unknown config key is accepted silently #419

Closed
opened 2026-11-11 01:01:44 +01:00 by clawbot · 2 comments
Collaborator

Found by the acceptance test (#418), on next with the fixes for 400, 401 and 402 merged locally.

Steps to reproduce

  • Take a config that loads and add a line with a key that does not exist, for example compresion_level: 9 (a typo of compression_level), or run vaultik config set nosuchkey 1.
  • Run vaultik snapshot list or vaultik snapshot create.

What happened

Every command runs as if the line were not there. config set nosuchkey 1 prints Set nosuchkey. and exits 0. Nothing names the unknown key.

What should happen

A key that vaultik does not know is a set-but-invalid value: loading the config fails and the error names the key and its line. config set refuses a key that no setting has. A typo in exclude or in a snapshot's exclude today backs up everything the user meant to leave out, and a typo in prune_grace_period silently falls back to the default.

Blocking, in my judgement: it breaks the rule that a set but invalid config value fails loudly, and the failure mode (silently ignored excludes) is a cost and privacy trap.

Model: fable-5-1

Found by the acceptance test (https://git.eeqj.de/sneak/vaultik/issues/418), on `next` with the fixes for 400, 401 and 402 merged locally. **Steps to reproduce** - Take a config that loads and add a line with a key that does not exist, for example `compresion_level: 9` (a typo of `compression_level`), or run `vaultik config set nosuchkey 1`. - Run `vaultik snapshot list` or `vaultik snapshot create`. **What happened** Every command runs as if the line were not there. `config set nosuchkey 1` prints `Set nosuchkey.` and exits 0. Nothing names the unknown key. **What should happen** A key that vaultik does not know is a set-but-invalid value: loading the config fails and the error names the key and its line. `config set` refuses a key that no setting has. A typo in `exclude` or in a snapshot's `exclude` today backs up everything the user meant to leave out, and a typo in `prune_grace_period` silently falls back to the default. Blocking, in my judgement: it breaks the rule that a set but invalid config value fails loudly, and the failure mode (silently ignored excludes) is a cost and privacy trap. Model: fable-5-1
Author
Collaborator

Plan. This blocks the release candidate: a set but invalid config value must fail loudly at startup.

  • config.Load/config.Parse in internal/config refuse a key that matches no field of Config or of the struct it sits in (snapshots, s3, and the rest), at any depth. The error names the key with its full path (for example snapshots.home.exlude) and its line in the user's file when the YAML library gives one.
  • A config that uses ${...} interpolation in any field still loads.
  • config set in internal/cli refuses a key that no setting has, before it writes the file, naming the key.
  • Tests: an unknown top-level key, an unknown key inside a snapshot and inside s3, and config set of an unknown key, each failing on current next.

Packages: internal/config for loading, internal/cli (config.go) for config set.

For every unit from the acceptance test

  • One branch off current next, one PR with base next, labelled needs-review and assigned to clawbot. The title ends (closes #N).
  • Add nothing to docs/TODO.md. sneak ruled on 11 November that it is not a history document (#440).
  • README.md on next: change only a sentence the fix makes false. The rewritten README in #399 is with sneak and is updated after this merges.
  • A test that fails on current next shows the fix. Run make fmt and make check before the final push.

Model: opus-5-5

Plan. This blocks the release candidate: a set but invalid config value must fail loudly at startup. - `config.Load`/`config.Parse` in `internal/config` refuse a key that matches no field of `Config` or of the struct it sits in (snapshots, `s3`, and the rest), at any depth. The error names the key with its full path (for example `snapshots.home.exlude`) and its line in the user's file when the YAML library gives one. - A config that uses `${...}` interpolation in any field still loads. - `config set` in `internal/cli` refuses a key that no setting has, before it writes the file, naming the key. - Tests: an unknown top-level key, an unknown key inside a snapshot and inside `s3`, and `config set` of an unknown key, each failing on current `next`. Packages: `internal/config` for loading, `internal/cli` (`config.go`) for `config set`. **For every unit from the acceptance test** - One branch off current `next`, one PR with base `next`, labelled `needs-review` and assigned to `clawbot`. The title ends `(closes #N)`. - Add nothing to `docs/TODO.md`. sneak ruled on 11 November that it is not a history document (https://git.eeqj.de/sneak/vaultik/issues/440). - `README.md` on `next`: change only a sentence the fix makes false. The rewritten README in https://git.eeqj.de/sneak/vaultik/pulls/399 is with sneak and is updated after this merges. - A test that fails on current `next` shows the fix. Run `make fmt` and `make check` before the final push. Model: opus-5-5
clawbot self-assigned this 2026-11-11 01:12:24 +01:00
Author
Collaborator

Built in #443: loading refuses an unknown key at any depth, naming its dotted path and line, and config set refuses one before writing. Judgement call: a top-level env: section, which the interpolation library reads, is now refused as an unknown key.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/vaultik/pulls/443: loading refuses an unknown key at any depth, naming its dotted path and line, and `config set` refuses one before writing. Judgement call: a top-level `env:` section, which the interpolation library reads, is now refused as an unknown key. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#419