refactor: mirror module namespaces to their directories (task 0031) #23

Merged
alexion merged 3 commits from task-0031-module-namespace-tidy into main 2026-07-23 21:41:56 -04:00
Owner

Task: .claude/tasks/0031-module-namespace-tidy.md

Summary

Adopt the convention that a Module's option path mirrors its directory under modules/, with an index file (name-matches-directory) declaring the directory's own segment rather than a doubled one.

  • Agent Modules grouped under modules.agents.*: claude-code (whole directory, assets included), pi (flattened to a single file), skills (renamed from agent-skills), and gitea-axi into an agents/tools/ subgroup. agents/ and tools/ are pure namespace prefixes — no aggregator enable.
  • hypridle and hyprlock nested under modules.desktop.hyprland.* (with hyprland.nix as the index), and the desktop aggregator updated.
  • Obsolete modules/example.nix removed.
  • Convention recorded in CONTEXT.md and ADR 0004; the neogaia host, the two live CLAUDE.md gotchas, and the skills Module's intentional-exception comment updated.

Verified: nix flake check builds checks.x86_64-linux.neogaia green; every new option path resolves and every old one (modules.claude-code, modules.pi, modules.gitea-axi, modules.example, modules.desktop.hypridle/.hyprlock) and would-be aggregator (modules.agents.enable, modules.agents.tools.enable) no longer resolves.

No deviations from the plan.

Review

Risk

Overall: Low

  • Blast radius — Low: touches many files, but all are mechanical namespace renames within one flake; only neogaia consumes them and it is updated in lockstep, no cross-repo or external callers.
  • Reversibility — Low: pure renames plus one file deletion (example.nix, a teaching stub); trivially revertible via git, no schema/migration/published-API change.
  • Test coverage — Low: nix flake check builds the host toplevel green, this repo's real build/verify seam, exercising every renamed option path.
  • Sensitive domain — Low: option-namespace reorganization only; no auth, secrets, permissions, or data logic changes (the agent-sudo-guard.sh hook is moved verbatim, not modified).
  • Size & complexity — Low: large file count but near-zero logical complexity — mostly 100%-similarity file moves and one-line cfg/option-path edits, no control-flow changes.
  • Runtime criticality — Low: dev/tooling modules on a personally-owned machine; a bad option name would fail the build rather than break runtime.

Standards — unaddressed

  • .claude/tasks/0031-*.md contains semicolons in prose — left as-is: task files are kept verbatim as historical record, which the task itself scopes out.

(All other Standards findings — semicolons and multi-sentence lines in the ADR and CONTEXT.md entry, and glossary-term/agent-state references in the skills.nix comment — were fixed and are in the diff.)

Spec — unaddressed

  • None. All acceptance criteria verified satisfied, no scope creep. One non-defect observation: the CONTEXT.md glossary entry references modules/ and "aggregate enable," judged to stay at convention level (matching the sibling Enable convention entry's style) rather than implementation detail.

— Claude

Task: `.claude/tasks/0031-module-namespace-tidy.md` ## Summary Adopt the convention that a Module's option path mirrors its directory under `modules/`, with an index file (name-matches-directory) declaring the directory's own segment rather than a doubled one. - Agent Modules grouped under `modules.agents.*`: `claude-code` (whole directory, assets included), `pi` (flattened to a single file), `skills` (renamed from `agent-skills`), and `gitea-axi` into an `agents/tools/` subgroup. `agents/` and `tools/` are pure namespace prefixes — no aggregator `enable`. - `hypridle` and `hyprlock` nested under `modules.desktop.hyprland.*` (with `hyprland.nix` as the index), and the desktop aggregator updated. - Obsolete `modules/example.nix` removed. - Convention recorded in `CONTEXT.md` and ADR 0004; the `neogaia` host, the two live `CLAUDE.md` gotchas, and the `skills` Module's intentional-exception comment updated. Verified: `nix flake check` builds `checks.x86_64-linux.neogaia` green; every new option path resolves and every old one (`modules.claude-code`, `modules.pi`, `modules.gitea-axi`, `modules.example`, `modules.desktop.hypridle`/`.hyprlock`) and would-be aggregator (`modules.agents.enable`, `modules.agents.tools.enable`) no longer resolves. No deviations from the plan. ## Review ### Risk **Overall: Low** - Blast radius — Low: touches many files, but all are mechanical namespace renames within one flake; only `neogaia` consumes them and it is updated in lockstep, no cross-repo or external callers. - Reversibility — Low: pure renames plus one file deletion (`example.nix`, a teaching stub); trivially revertible via git, no schema/migration/published-API change. - Test coverage — Low: `nix flake check` builds the host toplevel green, this repo's real build/verify seam, exercising every renamed option path. - Sensitive domain — Low: option-namespace reorganization only; no auth, secrets, permissions, or data logic changes (the `agent-sudo-guard.sh` hook is moved verbatim, not modified). - Size & complexity — Low: large file count but near-zero logical complexity — mostly 100%-similarity file moves and one-line `cfg`/option-path edits, no control-flow changes. - Runtime criticality — Low: dev/tooling modules on a personally-owned machine; a bad option name would fail the build rather than break runtime. ### Standards — unaddressed - `.claude/tasks/0031-*.md` contains semicolons in prose — left as-is: task files are kept verbatim as historical record, which the task itself scopes out. (All other Standards findings — semicolons and multi-sentence lines in the ADR and `CONTEXT.md` entry, and glossary-term/agent-state references in the `skills.nix` comment — were fixed and are in the diff.) ### Spec — unaddressed - None. All acceptance criteria verified satisfied, no scope creep. One non-defect observation: the `CONTEXT.md` glossary entry references `modules/` and "aggregate enable," judged to stay at convention level (matching the sibling `Enable convention` entry's style) rather than implementation detail. — Claude
alexion added 3 commits 2026-07-23 19:21:46 -04:00
Add the skills flake as an input and a module that imports its
home-manager module into every host via home-manager.sharedModules,
exposing programs.agents.skills. The global skill selection lives in
modules/agent-skills.nix and is empty for now; per-skill granularity
comes from the flake's own listOf-package option, and the placement
self-gates on the agent harness being enabled.
The lt alias walks the tree with -a, pulling the noisy .git directory
into every listing. Bake -I '.git' into it so the git internals are
skipped by default; extra ignores can still be passed at call time.
Adopt the convention that a Module's option path mirrors its directory
under modules/, with an index file naming the directory's own segment.

- Group agent Modules under modules.agents.*: claude-code (whole
  directory), pi (flattened to a file), skills (renamed from
  agent-skills), and gitea-axi under an agents/tools/ subgroup. The
  agents/ and tools/ folders are pure namespace prefixes with no
  aggregator enable.
- Nest hypridle and hyprlock under modules.desktop.hyprland.*, with
  hyprland.nix as the index, and update the desktop aggregator.
- Remove the obsolete example Module.
- Record the convention in CONTEXT.md and ADR 0004, and update the
  neogaia host, the two live CLAUDE.md gotchas, and the skills Module's
  intentional Enable-convention exception comment.
alexion merged commit e684ac481e into main 2026-07-23 21:41:56 -04:00
alexion deleted branch task-0031-module-namespace-tidy 2026-07-23 21:41:57 -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/dotfiles#23