Skip to content

fix: nested classification, hm-host bridge, bare aspect access - #501

Merged
sini merged 3 commits into
denful:mainfrom
sini:fix/nested-classification-and-hm-host
May 10, 2026
Merged

sini merged 3 commits into
denful:mainfrom
sini:fix/nested-classification-and-hm-host

Conversation

@sini

@sini sini commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three post-fx-pipeline regressions reported by a user after updating:

  • Nested classification false positive — freeform data keys with sub-keys matching registered class names (e.g. git.user colliding with den.classes.user) were misclassified as nested aspects, causing content to leak into class routing (users.users.loom.email does not exist). Added looksLikeClassContent guard to hasRecognizedSubKeys.

  • den.schema.hm-host not consumed — the ctx-shim forwarded den.ctx.hm-host to den.schema.hm-host.includes, but nothing in the pipeline read that schema. Added a policy.when-guarded bridge in the HM battery that injects hm-host schema includes via policy.include when the host has homeManager users.

  • Bare nested aspect access — aspectContentType wrapped all freeform values into opaque __contentValues wrappers, preventing direct attribute access like gloom.apps.polybar.razermon. Shallow-merge attrset definition values onto the wrapper so sub-keys are accessible for config access and includes.

Test plan

  • 758/758 CI tests pass (nix develop -c just ci)
  • New regression test test-class-name-collision-not-nested
  • User's dotfiles: all 8 nixosConfigurations eval on both main and new_den (migration) branches
  • den.ctx.hm-host deprecation warning fires and useGlobalPkgs propagates correctly

@sini
sini requested a review from theutz May 10, 2026 12:50
@sini
sini enabled auto-merge (squash) May 10, 2026 12:53
sini added 3 commits May 10, 2026 06:00
Freeform data keys with sub-keys that coincidentally match registered
class names (e.g. git.user colliding with den.classes.user) were
misclassified as nested aspects, causing their content to leak into
class routing (users.users.<name>.email does not exist).

Add looksLikeClassContent guard to hasRecognizedSubKeys so flat-scalar
attrsets are no longer treated as class content.

Bridge den.schema.hm-host includes into host resolution via a
policy.when-guarded policy that fires only for hosts with homeManager
users, restoring den.ctx.hm-host backward compatibility.
Shallow-merge attrset definition values onto the __contentValues
wrapper so nested freeform keys are directly accessible via config
attribute access (e.g. gloom.apps.polybar.razermon).

Enables bare nested aspect patterns without provides indirection.
Pipeline consumers continue using __contentValues; the forwarded
attributes are a convenience for direct access and includes.
@sini
sini force-pushed the fix/nested-classification-and-hm-host branch from 946f432 to e087a49 Compare May 10, 2026 13:00
@sini sini added allow-ci allow all CI integration tests merge-approved Approved, merge yourself when ready super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie. labels May 10, 2026
@sini
sini merged commit 5b0e247 into denful:main May 10, 2026
7 of 8 checks passed
charlesfire pushed a commit to charlesfire/den that referenced this pull request May 16, 2026
…l#501)

## Summary

Three post-fx-pipeline regressions reported by a user after updating:

- **Nested classification false positive** — freeform data keys with
sub-keys matching registered class names (e.g. `git.user` colliding with
`den.classes.user`) were misclassified as nested aspects, causing
content to leak into class routing (`users.users.loom.email` does not
exist). Added `looksLikeClassContent` guard to `hasRecognizedSubKeys`.

- **`den.schema.hm-host` not consumed** — the ctx-shim forwarded
`den.ctx.hm-host` to `den.schema.hm-host.includes`, but nothing in the
pipeline read that schema. Added a `policy.when`-guarded bridge in the
HM battery that injects `hm-host` schema includes via `policy.include`
when the host has homeManager users.

- **Bare nested aspect access** — `aspectContentType` wrapped all
freeform values into opaque `__contentValues` wrappers, preventing
direct attribute access like `gloom.apps.polybar.razermon`.
Shallow-merge attrset definition values onto the wrapper so sub-keys are
accessible for config access and includes.

## Test plan

- [x] 758/758 CI tests pass (`nix develop -c just ci`)
- [x] New regression test `test-class-name-collision-not-nested`
- [x] User's dotfiles: all 8 nixosConfigurations eval on both `main` and
`new_den` (migration) branches
- [x] `den.ctx.hm-host` deprecation warning fires and `useGlobalPkgs`
propagates correctly
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 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