Problem
In internal/config/config.go:257-333, updateMapping only writes non-zero fields. Existing values therefore cannot be cleared or reset through a Save round-trip.
Examples include:
- ports and port lists remain after setting them to empty.
- admin_addr remains after disabling the admin API.
- insecure: true remains after setting it back to false.
- Empty string and zero-valued settings remain stale in the YAML.
This can make mole config edit or other config mutations disagree with the effective runtime configuration.
Acceptance criteria
- Define an explicit distinction between “field not requested” and “field requested with its zero value”.
- Make clearing ports, admin_addr, insecure, and other resettable fields deterministic.
- Preserve comments, key order, and user-only YAML keys.
- Add tests for clearing booleans, strings, slices, and numeric values.
- Keep the documented precedence between defaults, YAML, and CLI flags.
Problem
In internal/config/config.go:257-333, updateMapping only writes non-zero fields. Existing values therefore cannot be cleared or reset through a Save round-trip.
Examples include:
This can make mole config edit or other config mutations disagree with the effective runtime configuration.
Acceptance criteria