feat(nix): check the home-manager module's composition (task 0047) #56

Merged
alexion merged 1 commits from task-0047-flake-check-hm-module-composition into main 2026-07-20 20:45:41 -04:00
Owner

Task: .claude/tasks/0047-flake-check-hm-module-composition.md

Summary

Adds the first automated proof of the home-manager module's composition (ADR 0021), so a change in home-manager or the Claude Code module that breaks how the Skill is declared fails nix flake check rather than a maintainer rebuild.

  • A home-manager flake input, its nixpkgs following this flake's, so the module is checked against the same nixpkgs-and-home-manager pairing a consumer following this flake would get. flake.lock updated.
  • A new home-manager-module check under checks, in checks/home-manager-module.nix, evaluating the real module through home-manager's standalone entry point and building config.home-files under four operator configurations, asserting on the file tree each produces:
    • attribute-set skills — the module's Skill and the operator's both land, each at its own name;
    • whole-directory (path-form) skills — the module's Skill lands beside the operator's directory contents (a non-recursive path-form install would fail this as a file collision);
    • Claude Code disabled — no gitea-axi Skill entry is written (guards the explicit sibling-enable gate);
    • operator's own SessionStart hook — the module's hook merges into that list rather than replacing it.

Building the home files derivation needs neither the Claude Code binary nor a running agent. The check reuses the package check's store path rather than rebuilding.

No deviations from the plan. nix flake check passes on the host system (and omits the incompatible aarch64-* systems by default, identical to the pre-existing package check).

Review

Risk

Overall: Low

  • Blast radius: Low — one check file plus flake input/output wiring; no product code or existing modules altered.
  • Reversibility: Low — pure additions (new file, flake input, lock entry); reverting the commit fully undoes it.
  • Test coverage: Low — the diff is a test, asserting on the built home-files tree rather than internals.
  • Sensitive domain: Low — no auth, secrets, permissions, or data handling.
  • Size & complexity: Low — ~136 lines of declarative Nix plus a small flake edit; a single homeFiles helper with four cases.
  • Runtime criticality: Low — dev/CI-only; never runs the CLI or an agent.

Unaddressed findings

None. The one actionable finding both the Standards and Spec axes raised — the merged-hook assertion coupling to the JSON emitter's colon spacing ("command": "gitea-axi") — was fixed in the diff by matching the quoted JSON string values instead. All other axis findings were judgement calls assessed as acceptable (self-contained per-scenario enable = true lines for readability; the IFD cross-system caveat, which mirrors the existing package check).

Task: `.claude/tasks/0047-flake-check-hm-module-composition.md` ## Summary Adds the first automated proof of the home-manager module's composition (ADR 0021), so a change in home-manager or the Claude Code module that breaks how the Skill is declared fails `nix flake check` rather than a maintainer rebuild. - A `home-manager` flake input, its nixpkgs following this flake's, so the module is checked against the same nixpkgs-and-home-manager pairing a consumer following this flake would get. `flake.lock` updated. - A new `home-manager-module` check under `checks`, in `checks/home-manager-module.nix`, evaluating the real module through home-manager's standalone entry point and building `config.home-files` under four operator configurations, asserting on the file tree each produces: - attribute-set skills — the module's Skill and the operator's both land, each at its own name; - whole-directory (path-form) skills — the module's Skill lands beside the operator's directory contents (a non-recursive path-form install would fail this as a file collision); - Claude Code disabled — no gitea-axi Skill entry is written (guards the explicit sibling-enable gate); - operator's own SessionStart hook — the module's hook merges into that list rather than replacing it. Building the home files derivation needs neither the Claude Code binary nor a running agent. The check reuses the package check's store path rather than rebuilding. No deviations from the plan. `nix flake check` passes on the host system (and omits the incompatible `aarch64-*` systems by default, identical to the pre-existing package check). ## Review ### Risk **Overall: Low** - Blast radius: Low — one check file plus flake input/output wiring; no product code or existing modules altered. - Reversibility: Low — pure additions (new file, flake input, lock entry); reverting the commit fully undoes it. - Test coverage: Low — the diff *is* a test, asserting on the built home-files tree rather than internals. - Sensitive domain: Low — no auth, secrets, permissions, or data handling. - Size & complexity: Low — ~136 lines of declarative Nix plus a small flake edit; a single `homeFiles` helper with four cases. - Runtime criticality: Low — dev/CI-only; never runs the CLI or an agent. ### Unaddressed findings None. The one actionable finding both the Standards and Spec axes raised — the merged-hook assertion coupling to the JSON emitter's colon spacing (`"command": "gitea-axi"`) — was fixed in the diff by matching the quoted JSON string values instead. All other axis findings were judgement calls assessed as acceptable (self-contained per-scenario `enable = true` lines for readability; the IFD cross-system caveat, which mirrors the existing package check).
alexion added 1 commit 2026-07-20 20:10:56 -04:00
feat(nix): check the home-manager module's composition (task 0047)
All checks were successful
CI / test (22) (pull_request) Successful in 49s
CI / test (true, 24) (pull_request) Successful in 1m5s
CI / flake (pull_request) Successful in 2s
CI / test (22) (push) Successful in 49s
CI / test (true, 24) (push) Successful in 1m3s
CI / flake (push) Successful in 3s
1468003f5b
Add a `home-manager` flake input, its nixpkgs following this flake's, and a
`home-manager-module` check that evaluates the real module through
home-manager's standalone entry point and builds the home files derivation
under four operator configurations, asserting on the tree each produces:
the Skill coexisting with an operator's own skills in both the attribute-set
and whole-directory forms, the sibling-enable gate leaving no Skill when
Claude Code is off, and the hook merging into an operator's own SessionStart
list. This is the first automated proof of the module's composition (ADR 0021),
replacing verification by maintainer rebuild.
alexion merged commit 1468003f5b into main 2026-07-20 20:45:41 -04:00
alexion deleted branch task-0047-flake-check-hm-module-composition 2026-07-20 20:45:41 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexion/gitea-axi#56