Skip to content

feat: forward and output resolution respects meta.adapter - #405

Merged
vic merged 1 commit into
denful:mainfrom
sini:sf5/forward-consumption
Apr 8, 2026
Merged

vic merged 1 commit into
denful:mainfrom
sini:sf5/forward-consumption

Conversation

@sini

@sini sini commented Apr 8, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@sini
sini requested a review from vic April 8, 2026 17:46
@sini
sini force-pushed the sf5/forward-consumption branch from bd477ad to c3d0355 Compare April 8, 2026 17:52
Comment thread modules/outputs.nix Resolved
Comment thread nix/lib/types.nix Resolved
Comment thread nix/lib/types.nix Resolved
@sini
sini force-pushed the sf5/forward-consumption branch from c3d0355 to fc70ebe Compare April 8, 2026 18:17
@vic
vic marked this pull request as draft April 8, 2026 18:25
@sini
sini force-pushed the sf5/forward-consumption branch 2 times, most recently from e835830 to 2bd9c5b Compare April 8, 2026 18:28
@sini
sini marked this pull request as ready for review April 8, 2026 18:30
@sini
sini requested a review from vic April 8, 2026 18:30
Comment thread nix/lib/types.nix Resolved
@sini
sini force-pushed the sf5/forward-consumption branch 2 times, most recently from 5325770 to 2f101fc Compare April 8, 2026 18:40
@sini
sini marked this pull request as draft April 8, 2026 18:47
Comment thread modules/options.nix Resolved
@sini
sini force-pushed the sf5/forward-consumption branch 6 times, most recently from 6b1f479 to 1f3819f Compare April 8, 2026 19:26
@sini
sini marked this pull request as ready for review April 8, 2026 19:26
@sini
sini requested a review from vic April 8, 2026 19:27
Entities expose .resolved (their context pipeline result) via the
entityCtx helper. forward.nix defaults to item.resolved when
fromAspect is absent, enabling cross-context forwarding. mainModule
simplified to use config.resolved directly, removing the mainModule
helper.

Adapter propagation tests consolidated into one file with end-to-end
coverage including transitive context-level filtering.
@sini
sini force-pushed the sf5/forward-consumption branch from 1f3819f to 68bb610 Compare April 8, 2026 19:31
@vic vic added the allow-ci allow all CI integration tests label Apr 8, 2026
@vic
vic merged commit 37297dd into denful:main Apr 8, 2026
25 of 28 checks passed
@vic

vic commented Apr 8, 2026

Copy link
Copy Markdown
Member

Amazing, @sini! keep those stacked PRs coming.

@sini
sini deleted the sf5/forward-consumption branch April 8, 2026 19:39
@vic vic added the super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie. label Apr 10, 2026
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