Skip to content

fix(std): observe everything htpasswd.entry and system.timezone apply - #644

Merged
haribo merged 2 commits into
developfrom
fix/635-observe-what-apply-sets
Sep 10, 2026
Merged

fix(std): observe everything htpasswd.entry and system.timezone apply#644
haribo merged 2 commits into
developfrom
fix/635-observe-what-apply-sets

Conversation

@haribo

@haribo haribo commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • htpasswd.entry now observes the mode its apply sets. A file whose stored hash already
    verified was reported already at 644, and the chmod 600 never ran — a credentials file
    left world-readable, under the def's own comment saying what that costs.
  • system.timezone now observes /etc/timezone as well as the symlink. A host with the
    right link and another zone in that file converged, and the file stayed wrong.
  • The observes changed; both applies were already correct.

The shape proposed in #636recorded: <file contents> — would not have converged
correctly: a field with no same-named parameter only has to be truthy
(internal/lang/eval.go:471-483), so any zone would pass. It is a comparison instead.

Test plan

Two adverse cases of the third kind (test/e2e/adverse-cases.md), each verified red on a
real container before the fix
:

RED   adverse-htpasswd.entry-mode          htpasswd.entry(…) ok.already  → file still 644
RED   adverse-system.timezone-recorded     system.timezone(…) ok.already → /etc/timezone Europe/Berlin

and green after, with convergence and the machine checked:

green adverse-htpasswd.entry-mode          htpasswd.entry(…) ok.set
green adverse-system.timezone-recorded     system.timezone(…) ok.set
run 1 htpasswd.entry ok.set      system.timezone ok.already
run 2 htpasswd.entry ok.already  system.timezone ok.already
600 /tmp/conv634/users · Europe/Paris · /usr/share/zoneinfo/Europe/Paris

Local gates: go test ./..., test/lint.sh, test/dead-code.sh,
test/coverage-ratchet.sh (81.8%), test/changelog-rule.sh, test/e2e/def-coverage.sh.

Also here

adverse-cases.md gains the rule this pair taught: a third-kind case must build a state the
def would call converged, or the apply runs for another reason and the assertion cannot
fail. Both defects already had an assertion beside them that passed for exactly that reason.
Its stale counts (8 cases / 38 defs) are corrected to 28 / 49 in passing.

Closes #635
Closes #636

@haribo
haribo merged commit e30fe0a into develop Sep 10, 2026
8 checks passed
@haribo
haribo deleted the fix/635-observe-what-apply-sets branch September 10, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant