Repository navigation
fix: parametric functions at direct freeform children leak through providerType.merge - #505
Merged
sini merged 3 commits intoMay 10, 2026
Conversation
Collaborator
Author
|
Is github broken? My earlier merged PR #501 isn't on main, but the PR is squash merged. |
Collaborator
Collaborator
Author
…ametric freeform children
When a parametric function (e.g. { host, user }: { homeManager = ... })
is placed as a direct freeform child of an aspect (ns.apps.helix instead
of ns.apps.provides.helix), aspectContentType wraps it in a
__contentValues wrapper. When this wrapper is used as an include element,
listOf (providerType ...) calls providerType.merge on each element,
promoting the wrapper to a full aspect with the parametric function
buried as a freeform key — unreachable by the pipeline's bind handler.
The fix normalizes __contentValues wrappers at the start of
providerType.merge: detect wrappers containing a single parametric
function (non-empty args, no config/options) and extract the raw
function so existing merge dispatch creates a proper __fn/__args wrapper.
Tests added:
- test-namespace-parametric-direct-child: nixos class via direct child
- test-namespace-parametric-hm-via-user-aspect: homeManager class via
intermediate aspect (matches real config pattern)
- test-namespace-parametric-provides-child: provides fallback (existing)
Add __contentValues and __provider to structuralKeysSet so they are never classified as class content when a content wrapper is promoted to a full aspect via providerType.merge. Without this, including a non-parametric direct freeform child (e.g. an overlay at ns.overlays.openrazer instead of ns.overlays.provides.openrazer) emits the nixos content twice — once from the forwarded attr and once from the __contentValues freeform key. Add test for the duplication scenario plus tests for parametric direct children via angle-brackets (nixos, homeManager-via-user-aspect, and provides-path comparison).
sini
force-pushed
the
fix/parametric-freeform-content-wrapper-leak
branch
from
May 10, 2026 21:10
0a0d906 to
ea3109a
Compare
vic
reviewed
May 10, 2026
Three related fixes for direct freeform children (no provides): 1. providerType.merge: inject name and meta.provider from __provider on content wrappers so aspectSubmodule.merge produces meaningful identities instead of anonymous include indices. 2. aspectSubmodule: thread providerPrefix through freeform type (same as provides submodule) so __provider includes the parent aspect name — e.g. ["gloom","overlays","openrazer"] not ["gloom","openrazer"]. 3. wrapChild: handle inner content wrappers that listOf passes through without calling providerType.merge. Injects identity from __provider and extracts parametric functions into includes. Without this, an aspect included from two paths (e.g. polybar→razermon→overlay and direct razermon→overlay) emits class content twice with different anonymous identities, bypassing dedup.
charlesfire
pushed a commit
to charlesfire/den
that referenced
this pull request
May 16, 2026
…oviderType.merge (denful#505) ## Summary - Fixes parametric functions (`{ host, user }: { ... }`) placed as direct freeform children of namespace aspects (e.g. `ns.apps.helix` instead of `ns.apps.provides.helix`) being silently dropped during pipeline resolution - The `__contentValues` wrapper from `aspectContentType` was promoted to a full aspect by `listOf (providerType ...)` element-level merge, burying the parametric function as a freeform key unreachable by bind/compile-parametric - Normalizes `__contentValues` wrappers in `providerType.merge` before dispatch: extracts single parametric functions (non-empty args, no `config`/`options`) so existing merge dispatch creates proper `__fn/__args` wrappers ## Test plan - [x] `test-namespace-parametric-direct-child` — nixos class via direct freeform child + angle brackets - [x] `test-namespace-parametric-hm-via-user-aspect` — homeManager class via intermediate aspect at user scope (matches real dotfiles pattern) - [x] `test-namespace-parametric-provides-child` — provides fallback path (was already working, verifies no regression) - [x] Full CI suite: 770/770 passing - [x] Verified against real config: `nixosConfigurations.evo-x2.config.home-manager.users.loom.programs.helix.enable` → `true`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{ host, user }: { ... }) placed as direct freeform children of namespace aspects (e.g.ns.apps.helixinstead ofns.apps.provides.helix) being silently dropped during pipeline resolution__contentValueswrapper fromaspectContentTypewas promoted to a full aspect bylistOf (providerType ...)element-level merge, burying the parametric function as a freeform key unreachable by bind/compile-parametric__contentValueswrappers inproviderType.mergebefore dispatch: extracts single parametric functions (non-empty args, noconfig/options) so existing merge dispatch creates proper__fn/__argswrappersTest plan
test-namespace-parametric-direct-child— nixos class via direct freeform child + angle bracketstest-namespace-parametric-hm-via-user-aspect— homeManager class via intermediate aspect at user scope (matches real dotfiles pattern)test-namespace-parametric-provides-child— provides fallback path (was already working, verifies no regression)nixosConfigurations.evo-x2.config.home-manager.users.loom.programs.helix.enable→true