Fixed
gateway keys addcorrupted the key file scaffolded bygateway init
(GH #716).initwrites the canonical empty setkeys = [];keys add
appended a[[keys]]table to that body, leaving BOTH representations in
the file — invalid TOML (duplicate key), so the documented onboarding flow
(init→keys add) failed on first use, and a fullrevokere-armed the
same trap.addnow strips the empty-array form before appending, and all
key-file writers (add/rotate/revoke) validate the assembled body
before the atomic swap — a bad assembly can never replace a good file on
disk. Regression tests cover init → add → revoke-to-empty → add and verify
a poisoned file is refused byte-for-byte untouched.
Upgrade
lean-ctx update # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.9.0...v3.9.1