Skip to content

fix: list-merge includes/excludes in content wrapper merge - #524

Merged
sini merged 1 commit into
denful:mainfrom
sini:fix/content-wrapper-includes-merge
May 12, 2026
Merged

sini merged 1 commit into
denful:mainfrom
sini:fix/content-wrapper-includes-merge

Conversation

@sini

@sini sini commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Content wrapper includes merge: When multiple modules each add children to an aspect's includes list (e.g., polybar.includes = [coreuse] in one file, polybar.includes = [wifi] in another), aspectContentType.merge shallow-merged forwarded attrs with foldl' //, keeping only the last module's list. Now includes and excludes are explicitly concatenated across all content value definitions.
  • mergeContentValuesPerKey includes handling: The per-key reconstruction in emitNestedAspect wrapped includes in a { __contentValues, __provider } content wrapper instead of list-concatenating, causing expected a list but found a set crashes on the auto-walk path. Now list-concatenates these structural keys.

Fixes a regression exposed by #521 — before that change, auto-walking masked the incomplete includes list by resolving nested keys regardless. After #521 correctly suppressed auto-walking for content wrappers, the incomplete includes became the only resolution path and children from earlier modules were silently dropped.

Test plan

  • Added regression test: multiple modules each contributing to polybar.includes — all children resolved
  • Added regression test: auto-walk path with multi-module includes — no crash, all children resolved
  • Existing nested-aspect-includes scoping tests pass (2/2)
  • Existing nested-aspect-merge test passes (1/1)
  • Existing nested-aspects suite passes (6/6)
  • Full CI: 778/778 passing

@sini sini added allow-ci allow all CI integration tests super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie. labels May 12, 2026
@sini
sini requested review from theutz and vic May 12, 2026 19:45
aspectContentType shallow-merges forwarded attrs with foldl' //.
This is last-win per key, which silently drops list values from
earlier modules — e.g., multiple modules each adding to includes
would only keep the last module's list.  Before denful#521 this was
masked by auto-walking nested keys; after denful#521 content wrappers
don't auto-walk, so the incomplete includes became the only
resolution path and children were silently dropped.

Generalize the fix to all list-valued keys rather than special-
casing includes/excludes by name: any key whose definitions are
all lists gets concatenated in both aspectContentType.merge (for
forwarded access) and mergeContentValuesPerKey (for auto-walk).
@sini
sini force-pushed the fix/content-wrapper-includes-merge branch from 616f368 to 2c842a5 Compare May 12, 2026 19:49
@sini
sini merged commit 82f080c into denful:main May 12, 2026
29 checks passed
charlesfire pushed a commit to charlesfire/den that referenced this pull request May 16, 2026
## Summary

- **Content wrapper includes merge**: When multiple modules each add
children to an aspect's `includes` list (e.g., `polybar.includes =
[coreuse]` in one file, `polybar.includes = [wifi]` in another),
`aspectContentType.merge` shallow-merged forwarded attrs with `foldl'
//`, keeping only the last module's list. Now `includes` and `excludes`
are explicitly concatenated across all content value definitions.
- **mergeContentValuesPerKey includes handling**: The per-key
reconstruction in `emitNestedAspect` wrapped `includes` in a `{
__contentValues, __provider }` content wrapper instead of
list-concatenating, causing `expected a list but found a set` crashes on
the auto-walk path. Now list-concatenates these structural keys.

Fixes a regression exposed by denful#521 — before that change, auto-walking
masked the incomplete includes list by resolving nested keys regardless.
After denful#521 correctly suppressed auto-walking for content wrappers, the
incomplete includes became the only resolution path and children from
earlier modules were silently dropped.

## Test plan

- [x] Added regression test: multiple modules each contributing to
`polybar.includes` — all children resolved
- [x] Added regression test: auto-walk path with multi-module includes —
no crash, all children resolved
- [x] Existing `nested-aspect-includes` scoping tests pass (2/2)
- [x] Existing `nested-aspect-merge` test passes (1/1)
- [x] Existing `nested-aspects` suite passes (6/6)
- [x] Full CI: 778/778 passing
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 super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants