Skip to content

fix: stable identity for bracket-resolved bare attrsets - #507

Merged
sini merged 1 commit into
denful:mainfrom
sini:fix/stable-bracket-identity-dedup
May 11, 2026
Merged

sini merged 1 commit into
denful:mainfrom
sini:fix/stable-bracket-identity-dedup

Conversation

@sini

@sini sini commented May 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Bracket resolution through forwarded attrs on content wrappers (e.g. <gloom/apps/polybar/razermon>) produces bare attrsets without __contentValues or __provider. Without identity, these get anonymous names and dedup fails when the same content is reached via multiple resolution paths.

  • den-brackets.nix: tagProvider injects __provider from the full bracket path onto bare attrset results
  • types.nix: providerType.merge normalization detects __provider (not just __contentValues) and injects name + meta.provider for stable identity

Fixes module duplication where entries appeared twice — once from the direct include path and once from host-aspects re-resolution with anonymous identity.

Test plan

  • 771/771 CI tests pass
  • den-configs polybar modules-right shows each module exactly once
  • diagram-demo template evaluates (148 checks)

Bracket resolution through forwarded attrs on content wrappers
(e.g. <gloom/apps/polybar/razermon>) produces bare attrsets without
__contentValues or __provider.  Without identity, these get anonymous
names in processInclude and dedup fails when the same content is
reached via multiple resolution paths (e.g. direct include + nested
key auto-resolution via host-aspects).

Two changes:

1. den-brackets.nix: tagProvider injects __provider from the full
   bracket path onto bare attrset results that lack identity.

2. types.nix: providerType.merge normalization detects values with
   __provider (not just __contentValues) and injects name +
   meta.provider for stable identity.  Guards __contentValues access
   for bare attrsets that only have __provider.
@sini
sini enabled auto-merge (squash) May 11, 2026 07:24
@sini sini added the allow-ci allow all CI integration tests label May 11, 2026
Comment thread nix/lib/aspects/types.nix
)
) d.value.__contentValues;
fns =
if d.value ? __contentValues then

@drupol drupol May 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can't we use lib.optionals ? (to get rid of the else [ ])

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gotchu next time I'm here. :D

@theutz theutz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bro

@sini
sini merged commit 912476c into denful:main May 11, 2026
28 of 33 checks passed
@vic vic added the merge-approved Approved, merge yourself when ready label May 11, 2026
charlesfire pushed a commit to charlesfire/den that referenced this pull request May 16, 2026
## Summary

Bracket resolution through forwarded attrs on content wrappers (e.g.
`<gloom/apps/polybar/razermon>`) produces bare attrsets without
`__contentValues` or `__provider`. Without identity, these get anonymous
names and dedup fails when the same content is reached via multiple
resolution paths.

- **den-brackets.nix**: `tagProvider` injects `__provider` from the full
bracket path onto bare attrset results
- **types.nix**: `providerType.merge` normalization detects `__provider`
(not just `__contentValues`) and injects `name` + `meta.provider` for
stable identity

Fixes module duplication where entries appeared twice — once from the
direct include path and once from host-aspects re-resolution with
anonymous identity.

## Test plan

- [x] 771/771 CI tests pass
- [x] den-configs polybar `modules-right` shows each module exactly once
- [x] diagram-demo template evaluates (148 checks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests merge-approved Approved, merge yourself when ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants