Repository navigation
feat: preserve aspect identity and adapter through functor evaluation - #398
Merged
Merged
Conversation
vic
previously requested changes
Apr 8, 2026
sini
force-pushed
the
sf1/identity-preservation-standalone
branch
from
April 8, 2026 05:59
12fe7bb to
45ff8f0
Compare
sini
commented
Apr 8, 2026
sini
force-pushed
the
sf1/identity-preservation-standalone
branch
from
April 8, 2026 06:17
45ff8f0 to
8fc3abf
Compare
Collaborator
Author
|
Alright, updated. |
vic
reviewed
Apr 8, 2026
vic
reviewed
Apr 8, 2026
sini
force-pushed
the
sf1/identity-preservation-standalone
branch
2 times, most recently
from
April 8, 2026 07:01
6596a03 to
f3b3e44
Compare
Collaborator
Author
|
awesome. I have 3 more commits staged but I'll save them for tomorrow. Goodnight and thank you for the reviews! edit: (what do you mean self.name isn't set... okay this is an easy fix... pushing in a minute.) |
Member
|
Awesome, run Good job so far, @sini. Thank you so much. |
withIdentity helper carries name and typed meta options (adapter, provider) through parametric functor results and ctxApply output. Freeform user meta is not propagated to avoid leaking to child include results. Den-internal meta (loc, name, file) are set by aspectMeta at merge time and not available during functor eval.
sini
force-pushed
the
sf1/identity-preservation-standalone
branch
from
April 8, 2026 07:14
f3b3e44 to
95f2d54
Compare
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.
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: