feat: per-aspect adapter accumulation in resolve#397
Merged
vic merged 1 commit intodenful:mainfrom Apr 8, 2026
Merged
Conversation
vic
requested changes
Apr 8, 2026
ddca3c7 to
ccd0ace
Compare
vic
requested changes
Apr 8, 2026
ccd0ace to
d9e711c
Compare
d9e711c to
dcbc01a
Compare
Collaborator
Author
|
For the remaining resolve changes: Resolve default applies the filterIncludes module because module alone doesn't act on meta.adapter, so filterIncludes is what reads it, composes the filter, probes includes, and tags survivors for propagation. If you want I can merge it into module, or keep them as separate compositions. |
Member
|
Run |
Adds meta.adapter option on aspects. Adapter accumulation logic lives entirely in adapters.filterIncludes — resolve.nix stays generic, only adding resolveChild to adapter args. Uses lastFunctionTo for correct merge semantics.
dcbc01a to
40809e5
Compare
Collaborator
Author
|
All clean now. |
Member
|
Awesome work @sini, you rock! 💯 |
vic
pushed a commit
that referenced
this pull request
Apr 8, 2026
…#398) Functor-producing functions in parametric.nix (applyIncludes, deepRecurse, withOwn) carry name, __provider, and eta.adapter from self into their return values. ctxApply also carries name and __provider on its result. Currently, when parametric functors evaluate, they return plain { includes = [...]; } attrsets — losing the aspect's identity. This means any code inspecting the resolved aspect (such as a custom adapter via resolve.withAdapter) sees incorrect defaults instead of the original aspect's name. This lays groundwork for context-level adapter resolution, where adapters declared on aspects or contexts need to propagate through the parametric pipeline to reach forward.nix and outputs.nix. Child includes are tagged with the parent's meta.adapter so adapters compose downward through the include tree. Upcoming related PRs: - #397 - Structural provider provenance via __provider paths - Context-level adapter on ctxApply result - Forward/output consumption of meta.adapter
vic
pushed a commit
that referenced
this pull request
Apr 8, 2026
## Summary
- Entities automatically expose `.resolved` — the result of their
context pipeline — derived from the schema type system
- `forward.nix` defaults to `item.resolved` when `fromAspect` is absent,
enabling cross-context forwarding without manual wiring
- `mainModule` helper eliminated — entity types resolve directly via
`config.resolved`
## What changed
**options.nix** — `schemaEntryType` wraps `deferredModule` to
auto-inject `config.resolved` for any schema entry where
`den.ctx.${kind}` exists. Context args are derived from the entity's
`_module.args`, filtered to known context kinds. No per-entity
boilerplate — host, user, and home all get `.resolved` automatically.
**types.nix** — `mainModule` helper removed. Both host and home
`mainModule` options simplified to `den.lib.aspects.resolve config.class
config.resolved`.
**forward.nix** — `asp` falls back to `item.resolved or item` when
`fromAspect` is absent.
## How context adapters flow through forwards
`den.ctx.host.meta.adapter` is carried through `ctxApply` (via
`withIdentity` from #398) onto `.resolved`. When `resolve` processes it,
`adapters.filterIncludes` (from #397) picks up the adapter and applies
it transitively to the entire subtree — including nested aspects reached
through forwards.
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.
Aspects can declare meta.adapter (typed nullOr functionTo raw) to compose into resolution for their subtree. resolve's go function accumulates aspect-level adapters as it descends, composing them with the inherited adapter.