You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Infinite recursion with den.lib.policy.when and <entity>.hasAspect #525
test-something=denTest({den,lib,igloo,# igloo = nixosConfigurations.igloo.configtuxHm,# tuxHm = igloo.home-manager.users.tux
...
}: {# replace <system> if you are reporting a bug in MacOSden.hosts.x86_64-linux.igloo.users.tux={};den.aspects.my-aspect.nixos.programs.git.enable=true;den.aspects.igloo.includes=[den.aspects.my-aspect];den.aspects.tux.includes=[(den.lib.policy.when({host, ...}: host.hasAspectden.aspects.git){nixos.programs.git.config.init.defaultBranch="custom-main";})];expr=igloo.programs.git.config.init.defaultBranch;expected="custom-main";});
I'm aware of this issue and don't know if I have the best answer for you yet. I would really like for this to be possible. What you're asking for when you say that is "Based on the final resolution, make a decision about the resolution." which is why this particular path is infinite, and I'm not sure how to handle this.
Would it make any sense in this case, @sini, to define a boolean on the host entity that could be used to toggle the inclusion of both aspects? As a workaround at least?
I mean yeah, any pattern that avoids creating this cycle would work. hasAspect is the only property that is derived from the pipeline and creates this cycle problem.
I may have a workaround by deferring and refiring unsatisfied policy guardfn's to later in the pipeline. It works in CI, I'll need you guys to verify if it works for you in the wild.
Activity
sini commentedon May 13, 2026
I'm aware of this issue and don't know if I have the best answer for you yet. I would really like for this to be possible. What you're asking for when you say that is "Based on the final resolution, make a decision about the resolution." which is why this particular path is infinite, and I'm not sure how to handle this.
theutz commentedon May 13, 2026
Would it make any sense in this case, @sini, to define a boolean on the host entity that could be used to toggle the inclusion of both aspects? As a workaround at least?
sini commentedon May 13, 2026
I mean yeah, any pattern that avoids creating this cycle would work. hasAspect is the only property that is derived from the pipeline and creates this cycle problem.
theutz commentedon May 13, 2026
Ok, good to know. Because I haven't done this yet, but it's something I probably totally would've done. :)
sini commentedon May 13, 2026
I definitely also did it during implementation and trust me I /really/ want this to work.
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
sini commentedon May 13, 2026
I may have a workaround by deferring and refiring unsatisfied policy guardfn's to later in the pipeline. It works in CI, I'll need you guys to verify if it works for you in the wild.
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles (#525)
fix: policy.when with hasAspect no longer cycles, policy.for accepts …
fix: deferred conditional guards drain at correct scope level (#540) (#…
fix: policy.when with hasAspect no longer cycles, policy.for accepts …
fix: deferred conditional guards drain at correct scope level (denful…