lazymartha#3: an unchanged save keeps the file; the header names the owner #4

Closed
terra wants to merge 0 commits from terra/3-unchanged-save into main
Member

Purpose (defect): a martha config save that changes nothing leaves the owner's .martha/martha.json as it was laid out.

  • The save goes through internal/layout: the same values hand back the bytes read from --in; a change keeps every key in the file's order (new keys after), two-space indent, no HTML escaping, final newline.
  • The header shows the declaration's owner, not the literal owner.
  • testdata/declaration/martha-init.json: the text martha init writes, made with martha's soloDeclaration.

Local: go vet ./... and go test ./... green; 7 mutants (sorted map save, no unchanged shortcut, sorted keys, no newline, HTML escape, literal owner, new-key order) each killed by a named test.

Refs #3

Purpose (defect): a `martha config` save that changes nothing leaves the owner's `.martha/martha.json` as it was laid out. - The save goes through `internal/layout`: the same values hand back the bytes read from `--in`; a change keeps every key in the file's order (new keys after), two-space indent, no HTML escaping, final newline. - The header shows the declaration's `owner`, not the literal `owner`. - `testdata/declaration/martha-init.json`: the text `martha init` writes, made with martha's `soloDeclaration`. Local: `go vet ./...` and `go test ./...` green; 7 mutants (sorted map save, no unchanged shortcut, sorted keys, no newline, HTML escape, literal owner, new-key order) each killed by a named test. Refs #3
lazymartha#3: an unchanged save keeps the file; the header names the owner
All checks were successful
test / test (pull_request) Successful in 39s
test / test (push) Successful in 29s
release / release (push) Successful in 2m1s
50c6663315
A save marshalled the declaration as a Go map, so every key came out
sorted and the final newline was dropped: `martha config` with nothing
edited rewrote the owner's .martha/martha.json. The save now goes
through internal/layout: the same values hand back the bytes read from
--in, and a change keeps every key in the file's order (a new key after
them), laid out as Martha writes a declaration: two-space indent, no
HTML escaping, a final newline.

The header passed the literal "owner" and read "owner owner"; it now
shows the declaration's own owner.

testdata/declaration/martha-init.json is the text `martha init` writes
for a solo crew, made with martha's soloDeclaration and written the way
martha writes it.

Refs martha-ai/lazymartha#3
rgfaber closed this pull request 2026-12-01 03:47:18 +00:00
Author
Member

Landed by fast-forward: lazymartha main is 50c6663315, this PR's head (PASS r=1 Uranus, CI 6072). The forge shows it closed rather than merged: this repository does not allow the manually-merged style (405), and the branch was removed after landing.

Landed by fast-forward: lazymartha main is 50c66633151f579b1d58fc09f639441cba8aebc4, this PR's head (PASS r=1 Uranus, CI 6072). The forge shows it closed rather than merged: this repository does not allow the manually-merged style (405), and the branch was removed after landing.
All checks were successful
test / test (pull_request) Successful in 39s
test / test (push) Successful in 29s
release / release (push) Successful in 2m1s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/lazymartha!4
No description provided.