An unchanged save reorders the declaration's keys and drops its final newline #3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (defect): a
martha configsave that changes nothing leaves the owner's.martha/martha.jsonas it was laid out.Found while reviewing martha-ai/martha#317 L4 (PR 328, tip 876a3dc6), in a real run: lazymartha built from main
cc7b2a6, placed as a release'sbin/lazymartha, thenmartha initfollowed bymartha configwithspressed and nothing edited.cmd/lazymartha/main.go:178marshals the declaration as a Go map, so every key comes out sorted and the file has no trailing newline. Martha writes the proposed text as it is, so an unchanged save rewrites the owner's file: same content (checked by parsing both), different text. Expected: an unchanged declaration comes back byte for byte, and an edit moves only the keys it touches.cmd/lazymartha/main.go:85passes"owner", so the header line readsowner owner. The declaration has anownerfield; the header should show its value.martha's L4 tests use a stand-in that copies
--into--out, so they cannot see item 1. A fixture captured from a real save, used by both repos, would show it.Refs martha-ai/martha#317
Landed on main
50c66633(PR #4, PASS r=1 Uranus, CI 6072).Done when, against the issue:
--in(internal/layout); tested on the textmartha initwrites (testdata/declaration/martha-init.json) and on a hand-laid file.ownervalue, not the literalowner.Not done here: sharing the fixture with martha's L4 stand-in (martha side).