The current setup for working on this Collection and its consumer (the environment repository, Defame1297/ansible-homelab-mono) from one Claude Code session does not work well. The Kamino clone lives inside the environment repository at .dev/ansible_collections/mortis/kamino (git-ignored there), and the session works in both repositories at once. The friction below was seen on 2026-11-10 while releasing 1.2.0 (systemd_hardening, network_interfaces) and cutting the consumer over. It is a record of what happened, not a proposed design.
What went wrong
Shared tool state. Kamino's ansible-lint (mock_roles in .ansible-lint) leaves an empty ~/.ansible/collections/ansible_collections/mortis/kamino/roles directory. The environment repository's ansible-lint puts ~/.ansible/collections first on its path, so the empty mock hides the real Collection and the cutover commit fails with "role 'mortis.kamino.systemd_hardening' was not found". Every Kamino commit plants it again. It happened after the fail2ban cutover too (environment repo #486, 2026-11-09). The fix by hand is deleting the directory, and the Claude Code permission classifier denied that delete as irreversible, so the commit was blocked until the operator acted.
Two repositories, one shell. The working directory drifts into the clone after a cd, so every command must use git -C or absolute paths. A commit in the wrong repository is one forgotten flag away. Each repository has its own hooks and virtualenv, and a hook run without the right virtualenv activated fails (the environment repo's ansible-lint hook failed once for exactly that).
Slow, heavy hooks. The first hook run takes minutes, and a Renovate bump of a hook rebuilds its environment (a node-gyp compile of re2 took several minutes). The control host disk reached 92%, mostly from pre-commit environments across the two repositories (5.1 GB), and had to be cleaned during the session.
Network path.git.rkdr.net now resolves only to Cloudflare IPv6 addresses from the control host, so SSH pushes fail. Pushes only worked with a per-command GIT_SSH_COMMAND override to the LAN address.
A long release chain across two repositories. Kamino PR, Kamino release PR, tag, environment pin PR, runner image build, workflow pin PR, then the cutover PR. Each step waits for the previous one, and Renovate bumps landing in between (an IMAGE_VERSION conflict, then an ansible-core 2.22.0 pin that broke the image build for everyone) added unplanned rounds.
Easy to confuse the repositories. Branch names, PR numbers, issue numbers and the epic (#486) live in the environment repository, while the code lives here. The session has to keep two sets of conventions, CLAUDE.md files and guard hooks straight.
What a redesign should settle (not decided)
Where each repository's working copy lives, and whether the nesting stays.
Whether Claude Code sessions are scoped to one repository at a time, or work in both, and how a cross-repository change is sequenced.
Isolation of tool state per repository: ANSIBLE_HOME, the pre-commit cache, virtualenvs, so that one repository's lint cannot change the other's results.
A cheaper local check loop (hook run time, disk use).
A documented, tested procedure for a Collection release and its consumer cutover, replacing the tribal knowledge in the environment repository's epic comments.
Acceptance criteria
A Kamino commit does not change the result of the environment repository's lint, and the reverse.
A role release and cutover can be done from a documented procedure without manual cleanup of shared state.
The decision on repository layout and session scoping is recorded (ADR 0004 in the environment repository, or a new one).
Out of scope
The org-wide package secret (#13) and the fork pull request stance, which have their own records.
## Problem
The current setup for working on this Collection and its consumer (the environment repository, `Defame1297/ansible-homelab-mono`) from one Claude Code session does not work well. The Kamino clone lives inside the environment repository at `.dev/ansible_collections/mortis/kamino` (git-ignored there), and the session works in both repositories at once. The friction below was seen on 2026-11-10 while releasing 1.2.0 (`systemd_hardening`, `network_interfaces`) and cutting the consumer over. It is a record of what happened, not a proposed design.
## What went wrong
1. **Shared tool state.** Kamino's `ansible-lint` (`mock_roles` in `.ansible-lint`) leaves an empty `~/.ansible/collections/ansible_collections/mortis/kamino/roles` directory. The environment repository's `ansible-lint` puts `~/.ansible/collections` first on its path, so the empty mock hides the real Collection and the cutover commit fails with "role 'mortis.kamino.systemd_hardening' was not found". Every Kamino commit plants it again. It happened after the `fail2ban` cutover too (environment repo #486, 2026-11-09). The fix by hand is deleting the directory, and the Claude Code permission classifier denied that delete as irreversible, so the commit was blocked until the operator acted.
2. **Two repositories, one shell.** The working directory drifts into the clone after a `cd`, so every command must use `git -C` or absolute paths. A commit in the wrong repository is one forgotten flag away. Each repository has its own hooks and virtualenv, and a hook run without the right virtualenv activated fails (the environment repo's `ansible-lint` hook failed once for exactly that).
3. **Slow, heavy hooks.** The first hook run takes minutes, and a Renovate bump of a hook rebuilds its environment (a `node-gyp` compile of `re2` took several minutes). The control host disk reached 92%, mostly from pre-commit environments across the two repositories (5.1 GB), and had to be cleaned during the session.
4. **Network path.** `git.rkdr.net` now resolves only to Cloudflare IPv6 addresses from the control host, so SSH pushes fail. Pushes only worked with a per-command `GIT_SSH_COMMAND` override to the LAN address.
5. **A long release chain across two repositories.** Kamino PR, Kamino release PR, tag, environment pin PR, runner image build, workflow pin PR, then the cutover PR. Each step waits for the previous one, and Renovate bumps landing in between (an `IMAGE_VERSION` conflict, then an `ansible-core` 2.22.0 pin that broke the image build for everyone) added unplanned rounds.
6. **Easy to confuse the repositories.** Branch names, PR numbers, issue numbers and the epic (#486) live in the environment repository, while the code lives here. The session has to keep two sets of conventions, CLAUDE.md files and guard hooks straight.
## What a redesign should settle (not decided)
- Where each repository's working copy lives, and whether the nesting stays.
- Whether Claude Code sessions are scoped to one repository at a time, or work in both, and how a cross-repository change is sequenced.
- Isolation of tool state per repository: `ANSIBLE_HOME`, the pre-commit cache, virtualenvs, so that one repository's lint cannot change the other's results.
- A cheaper local check loop (hook run time, disk use).
- A documented, tested procedure for a Collection release and its consumer cutover, replacing the tribal knowledge in the environment repository's epic comments.
## Acceptance criteria
- A Kamino commit does not change the result of the environment repository's lint, and the reverse.
- A role release and cutover can be done from a documented procedure without manual cleanup of shared state.
- The decision on repository layout and session scoping is recorded (ADR 0004 in the environment repository, or a new one).
## Out of scope
The org-wide package secret (#13) and the fork pull request stance, which have their own records.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Changes since the issue was written. They are a stopgap and do not settle the redesign.
Working copy moved (point 2). The Collection is now cloned at /root/kamino, next to the environment repository, no longer inside it under .dev/ansible_collections/mortis/kamino. The old clone was clean and fully pushed; it was deleted. The environment repository's CLAUDE.md is updated in Defame1297/ansible-homelab-mono#767 (open). scripts/dev-setup.sh has not been run in the new clone yet, so it has no virtualenv or hooks.
Layout cost. ADR 0004's dev loop needs an ansible_collections/mortis/kamino path; /root/kamino does not have it, so #767 documents a symlink under ~/dev. That is one more moving part, which argues for settling the layout properly.
Network path (point 4) fixed on the resolver. The operator added a local A record git.rkdr.net to 10.11.50.11 on the backup Pi-hole (10.11.50.191, not in either repository). Plain ssh -T [email protected] from the control host authenticates now, without the GIT_SSH_COMMAND override. Leftovers still there at the last check: the Cloudflare A answers (188.114.96.0, 188.114.97.0) and the Cloudflare AAAA answers. The host has no IPv6 route and the local address is listed first, so it works today, but it depends on address order.
Not changed (point 1). The shared ~/.ansible/collections/ansible_collections/mortis/kamino shadow is still created by this repository's lint whenever its hooks run in a clone; the new location does not isolate it. Per-repository ANSIBLE_HOME and a separate pre-commit cache are still the open questions above.
Also seen today, unrelated to the layout: opening https://git.rkdr.net from the operator's PC over Tailscale showed a self-signed certificate error (MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT). From the control host, 10.11.50.11:443 serves a valid Let's Encrypt certificate for git.rkdr.net, so the cause is probably on the PC's side (which address it resolves). Not diagnosed yet.
## Update 2026-11-10 (later)
Changes since the issue was written. They are a stopgap and do not settle the redesign.
- **Working copy moved (point 2).** The Collection is now cloned at `/root/kamino`, next to the environment repository, no longer inside it under `.dev/ansible_collections/mortis/kamino`. The old clone was clean and fully pushed; it was deleted. The environment repository's `CLAUDE.md` is updated in Defame1297/ansible-homelab-mono#767 (open). `scripts/dev-setup.sh` has not been run in the new clone yet, so it has no virtualenv or hooks.
- **Layout cost.** ADR 0004's dev loop needs an `ansible_collections/mortis/kamino` path; `/root/kamino` does not have it, so #767 documents a symlink under `~/dev`. That is one more moving part, which argues for settling the layout properly.
- **Network path (point 4) fixed on the resolver.** The operator added a local A record `git.rkdr.net` to `10.11.50.11` on the backup Pi-hole (`10.11.50.191`, not in either repository). Plain `ssh -T [email protected]` from the control host authenticates now, without the `GIT_SSH_COMMAND` override. Leftovers still there at the last check: the Cloudflare A answers (`188.114.96.0`, `188.114.97.0`) and the Cloudflare AAAA answers. The host has no IPv6 route and the local address is listed first, so it works today, but it depends on address order.
- **Not changed (point 1).** The shared `~/.ansible/collections/ansible_collections/mortis/kamino` shadow is still created by this repository's lint whenever its hooks run in a clone; the new location does not isolate it. Per-repository `ANSIBLE_HOME` and a separate pre-commit cache are still the open questions above.
Also seen today, unrelated to the layout: opening `https://git.rkdr.net` from the operator's PC over Tailscale showed a self-signed certificate error (`MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT`). From the control host, `10.11.50.11:443` serves a valid Let's Encrypt certificate for `git.rkdr.net`, so the cause is probably on the PC's side (which address it resolves). Not diagnosed yet.
Two more data points from the system_baseline release (2026-11-14, #114, #115, v1.3.0; environment repo #795 to #797):
Committing from a git worktree of the environment repo is unsafe. The environment repo's install-collections pre-commit hook runs ansible-galaxy, which clones this repository with git. When the commit is made in a worktree, git exports the worktree's GIT_* variables to the hooks, and ansible-galaxy's git clone and checkout ran against the environment worktree instead of the clone:
this repository's files (for example images/ci/Dockerfile) were read into the worktree's index;
the checkout v1.3.0 failed with pathspec 'v1.3.0' did not match;
the index then referenced objects that did not exist (fatal: unable to read <sha>).
The damage stayed in the throwaway worktree, and the main checkout and branches were intact. Committing from the normal checkout worked. Until that is fixed, "work in a second worktree" is not an option for the environment repo.
Lint parity: local ansible-lint passed on system_baseline only because ~/.ansible/collections on the control host has community.general 13.5.0 and ansible.posix. CI has neither and failed. Tracked in the issue on baking the dependency collections into the ci image (filed today). The stray ~/.ansible/collections/ansible_collections/mortis/kamino directory did not come back this time: Kamino's ansible-lint wrote its mocks to the project-local .ansible/.
Two more data points from the `system_baseline` release (2026-11-14, #114, #115, `v1.3.0`; environment repo #795 to #797):
1. **Committing from a git worktree of the environment repo is unsafe.** The environment repo's `install-collections` pre-commit hook runs `ansible-galaxy`, which clones this repository with `git`. When the commit is made in a worktree, git exports the worktree's `GIT_*` variables to the hooks, and `ansible-galaxy`'s `git clone` and `checkout` ran against the environment worktree instead of the clone:
- this repository's files (for example `images/ci/Dockerfile`) were read into the worktree's index;
- the `checkout v1.3.0` failed with `pathspec 'v1.3.0' did not match`;
- the index then referenced objects that did not exist (`fatal: unable to read <sha>`).
The damage stayed in the throwaway worktree, and the main checkout and branches were intact. Committing from the normal checkout worked. Until that is fixed, "work in a second worktree" is not an option for the environment repo.
2. **Lint parity:** local `ansible-lint` passed on `system_baseline` only because `~/.ansible/collections` on the control host has `community.general` 13.5.0 and `ansible.posix`. CI has neither and failed. Tracked in the issue on baking the dependency collections into the `ci` image (filed today). The stray `~/.ansible/collections/ansible_collections/mortis/kamino` directory did not come back this time: Kamino's `ansible-lint` wrote its mocks to the project-local `.ansible/`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This issue asks for a decision recorded in the environment repository, which the map puts out of scope. Its text also holds internal network detail on a tracker that is readable without an account; see Does the stand-alone rule cover issue text and job logs.
Recommended: the maintainer moves it to the environment repository's tracker and closes it here. Two of its points concern this repository (lint writing into a shared ~/.ansible, the cost of hook environments) and can be filed here if they still hold.
Review of the map (2026-11-17).
- This issue asks for a decision recorded in the environment repository, which the map puts out of scope. Its text also holds internal network detail on a tracker that is readable without an account; see [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253).
- Recommended: the maintainer moves it to the environment repository's tracker and closes it here. Two of its points concern this repository (lint writing into a shared `~/.ansible`, the cost of hook environments) and can be filed here if they still hold.
Out of scope for this repository's tracker, by [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253). The maintainer copies it out first; then it is closed and redacted by [chore: redact host, network and private-repository detail from the tracker](https://git.rkdr.net/Mortis/Kamino/issues/265).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The current setup for working on this Collection and its consumer (the environment repository,
Defame1297/ansible-homelab-mono) from one Claude Code session does not work well. The Kamino clone lives inside the environment repository at.dev/ansible_collections/mortis/kamino(git-ignored there), and the session works in both repositories at once. The friction below was seen on 2026-11-10 while releasing 1.2.0 (systemd_hardening,network_interfaces) and cutting the consumer over. It is a record of what happened, not a proposed design.What went wrong
ansible-lint(mock_rolesin.ansible-lint) leaves an empty~/.ansible/collections/ansible_collections/mortis/kamino/rolesdirectory. The environment repository'sansible-lintputs~/.ansible/collectionsfirst on its path, so the empty mock hides the real Collection and the cutover commit fails with "role 'mortis.kamino.systemd_hardening' was not found". Every Kamino commit plants it again. It happened after thefail2bancutover too (environment repo #486, 2026-11-09). The fix by hand is deleting the directory, and the Claude Code permission classifier denied that delete as irreversible, so the commit was blocked until the operator acted.cd, so every command must usegit -Cor absolute paths. A commit in the wrong repository is one forgotten flag away. Each repository has its own hooks and virtualenv, and a hook run without the right virtualenv activated fails (the environment repo'sansible-linthook failed once for exactly that).node-gypcompile ofre2took several minutes). The control host disk reached 92%, mostly from pre-commit environments across the two repositories (5.1 GB), and had to be cleaned during the session.git.rkdr.netnow resolves only to Cloudflare IPv6 addresses from the control host, so SSH pushes fail. Pushes only worked with a per-commandGIT_SSH_COMMANDoverride to the LAN address.IMAGE_VERSIONconflict, then anansible-core2.22.0 pin that broke the image build for everyone) added unplanned rounds.What a redesign should settle (not decided)
ANSIBLE_HOME, the pre-commit cache, virtualenvs, so that one repository's lint cannot change the other's results.Acceptance criteria
Out of scope
The org-wide package secret (#13) and the fork pull request stance, which have their own records.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Update 2026-11-10 (later)
Changes since the issue was written. They are a stopgap and do not settle the redesign.
/root/kamino, next to the environment repository, no longer inside it under.dev/ansible_collections/mortis/kamino. The old clone was clean and fully pushed; it was deleted. The environment repository'sCLAUDE.mdis updated in Defame1297/ansible-homelab-mono#767 (open).scripts/dev-setup.shhas not been run in the new clone yet, so it has no virtualenv or hooks.ansible_collections/mortis/kaminopath;/root/kaminodoes not have it, so #767 documents a symlink under~/dev. That is one more moving part, which argues for settling the layout properly.git.rkdr.netto10.11.50.11on the backup Pi-hole (10.11.50.191, not in either repository). Plainssh -T [email protected]from the control host authenticates now, without theGIT_SSH_COMMANDoverride. Leftovers still there at the last check: the Cloudflare A answers (188.114.96.0,188.114.97.0) and the Cloudflare AAAA answers. The host has no IPv6 route and the local address is listed first, so it works today, but it depends on address order.~/.ansible/collections/ansible_collections/mortis/kaminoshadow is still created by this repository's lint whenever its hooks run in a clone; the new location does not isolate it. Per-repositoryANSIBLE_HOMEand a separate pre-commit cache are still the open questions above.Also seen today, unrelated to the layout: opening
https://git.rkdr.netfrom the operator's PC over Tailscale showed a self-signed certificate error (MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT). From the control host,10.11.50.11:443serves a valid Let's Encrypt certificate forgit.rkdr.net, so the cause is probably on the PC's side (which address it resolves). Not diagnosed yet.Two more data points from the
system_baselinerelease (2026-11-14, #114, #115,v1.3.0; environment repo #795 to #797):Committing from a git worktree of the environment repo is unsafe. The environment repo's
install-collectionspre-commit hook runsansible-galaxy, which clones this repository withgit. When the commit is made in a worktree, git exports the worktree'sGIT_*variables to the hooks, andansible-galaxy'sgit cloneandcheckoutran against the environment worktree instead of the clone:images/ci/Dockerfile) were read into the worktree's index;checkout v1.3.0failed withpathspec 'v1.3.0' did not match;fatal: unable to read <sha>).The damage stayed in the throwaway worktree, and the main checkout and branches were intact. Committing from the normal checkout worked. Until that is fixed, "work in a second worktree" is not an option for the environment repo.
Lint parity: local
ansible-lintpassed onsystem_baselineonly because~/.ansible/collectionson the control host hascommunity.general13.5.0 andansible.posix. CI has neither and failed. Tracked in the issue on baking the dependency collections into theciimage (filed today). The stray~/.ansible/collections/ansible_collections/mortis/kaminodirectory did not come back this time: Kamino'sansible-lintwrote its mocks to the project-local.ansible/.🤖 Generated with Claude Code
https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Review of the map (2026-11-17).
~/.ansible, the cost of hook environments) and can be filed here if they still hold.Out of scope for this repository's tracker, by Does the stand-alone rule cover issue text and job logs. The maintainer copies it out first; then it is closed and redacted by chore: redact host, network and private-repository detail from the tracker.