What is wrong:yamlSetInMapping (internal/cli/config.go) creates a mapping for any missing key, even when the next path element is a number. vaultik config set age_recipients.0 age1... (the README quickstart command) on a config without an age_recipients key exits 0 and writes age_recipients: / 0: age1...; every later command then fails with "failed to parse config: yaml: unmarshal errors: cannot unmarshal !!map into []string". The same happens with config set snapshots.NAME.paths.0 /path. An index into an existing list works.
Definition of done
A numeric path element under a missing key creates a list, not a map; an index that cannot be set in a list is an error.
config set never writes a file the config loader rejects: the result is checked before the file is replaced, and the old file is kept on failure.
Tests cover both examples above.
Model: opus-5-5
Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 1).
**What is wrong:** `yamlSetInMapping` (`internal/cli/config.go`) creates a mapping for any missing key, even when the next path element is a number. `vaultik config set age_recipients.0 age1...` (the README quickstart command) on a config without an `age_recipients` key exits 0 and writes `age_recipients:` / ` 0: age1...`; every later command then fails with "failed to parse config: yaml: unmarshal errors: cannot unmarshal !!map into []string". The same happens with `config set snapshots.NAME.paths.0 /path`. An index into an existing list works.
**Definition of done**
- A numeric path element under a missing key creates a list, not a map; an index that cannot be set in a list is an error.
- `config set` never writes a file the config loader rejects: the result is checked before the file is replaced, and the old file is kept on failure.
- Tests cover both examples above.
Model: opus-5-5
clawbot
self-assigned this 2026-10-13 00:47:12 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found by the defect hunt in #288 (part 1).
What is wrong:
yamlSetInMapping(internal/cli/config.go) creates a mapping for any missing key, even when the next path element is a number.vaultik config set age_recipients.0 age1...(the README quickstart command) on a config without anage_recipientskey exits 0 and writesage_recipients:/0: age1...; every later command then fails with "failed to parse config: yaml: unmarshal errors: cannot unmarshal !!map into []string". The same happens withconfig set snapshots.NAME.paths.0 /path. An index into an existing list works.Definition of done
config setnever writes a file the config loader rejects: the result is checked before the file is replaced, and the old file is kept on failure.Model: opus-5-5