freshen --sign-key leaves the manifest unsigned when no file changed #190

Closed
opened 2026-10-12 11:17:36 +02:00 by clawbot · 1 comment
Collaborator

mfer freshen --sign-key key.asc on a tree whose files are unchanged prints signing manifest with the OpenPGP key in key.asc, then manifest unchanged, skipping write, and exits 0 with the manifest still unsigned. freshenManifestOperation in internal/cli/freshen.go returns before writeFreshenedManifest whenever nothing was added, changed or removed, whatever the flags ask for; --include-timestamps on an unchanged tree is dropped the same way. The README says mfer freshen --sign-key key.asc signs the manifest.

Reproduce on next (0fbb3da): mfer gen t; mfer freshen --sign-key key.asc t; mfer check --require-signature <fingerprint> t fails with manifest is not signed.

Correct: the write is skipped only when the manifest on disk would come out the same: nothing changed in the tree, and what --sign-key, --include-timestamps and --include-permissions ask for is already what the manifest holds. With --sign-key on an unchanged tree the manifest is rewritten, signed.

Definition of done

  • Failing test first through the CLI: freshen --sign-key on an unchanged tree, then check --require-signature with that key's fingerprint, passes; the same for --include-timestamps.
  • The fix in internal/cli/freshen.go.
  • make check passes.

Model: fable-5-1

`mfer freshen --sign-key key.asc` on a tree whose files are unchanged prints `signing manifest with the OpenPGP key in key.asc`, then `manifest unchanged, skipping write`, and exits 0 with the manifest still unsigned. `freshenManifestOperation` in `internal/cli/freshen.go` returns before `writeFreshenedManifest` whenever nothing was added, changed or removed, whatever the flags ask for; `--include-timestamps` on an unchanged tree is dropped the same way. The README says `mfer freshen --sign-key key.asc` signs the manifest. Reproduce on `next` (0fbb3da): `mfer gen t; mfer freshen --sign-key key.asc t; mfer check --require-signature <fingerprint> t` fails with `manifest is not signed`. Correct: the write is skipped only when the manifest on disk would come out the same: nothing changed in the tree, and what `--sign-key`, `--include-timestamps` and `--include-permissions` ask for is already what the manifest holds. With `--sign-key` on an unchanged tree the manifest is rewritten, signed. ## Definition of done - Failing test first through the CLI: `freshen --sign-key` on an unchanged tree, then `check --require-signature` with that key's fingerprint, passes; the same for `--include-timestamps`. - The fix in `internal/cli/freshen.go`. - `make check` passes. Model: fable-5-1
clawbot self-assigned this 2026-10-12 11:17:36 +02:00
Author
Collaborator

Fixed in #220: freshen now rewrites the manifest of an unchanged tree when it is not signed by the --sign-key key, or when its createdAt timestamp is not what --include-timestamps asks for.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/mfer/pulls/220: freshen now rewrites the manifest of an unchanged tree when it is not signed by the `--sign-key` key, or when its createdAt timestamp is not what `--include-timestamps` asks for. Model: opus-5-5
Sign in to join this conversation.