Skip to content

Conversation

@vic
Copy link
Owner

@vic vic commented Dec 1, 2025

This PR is for solving vic/den#113

superseded by #25

Copilot AI review requested due to automatic review settings December 1, 2025 21:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This WIP PR refactors the type system and test infrastructure for the flake-aspects project. The changes primarily consolidate type definitions for better reusability and split a monolithic test file into individual, more maintainable test modules.

Key changes:

  • Simplified type definitions by reusing aspectsType for the provides option, eliminating duplication
  • Refactored the order of type definitions, placing providerType to accept aspectSubmoduleAttrs first, then functionProviderType
  • Split checkmate/modules/tests.nix into 14 individual test files for better organization and maintainability

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nix/types.nix Refactored type definitions: simplified aspectsType usage for freeformType, reordered providerType definition, and replaced inline submodule with aspectsType for provides option
checkmate/modules/tests.nix Completely restructured from a monolithic test file to a minimal module args provider that exports helper functions and imports
checkmate/modules/tests/*.nix New individual test files covering various aspect functionality: dependencies, provides, fixpoints, parametric aspects, default providers, chain resolution, and transpose operations
checkmate/modules/checkmate.nix New configuration file for checkmate module importing nix-unit and treefmt-nix with formatter settings
checkmate/flake.nix New flake configuration for the checkmate test infrastructure with proper input dependencies
checkmate/flake.lock Lock file for checkmate flake dependencies
.github/workflows/test.yml Updated workflow to reference the checkmate subdirectory using ?dir=checkmate parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 2, 2025 16:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vic vic changed the title WIP: Provider type WIP: Merging aspects Dec 16, 2025
@vic
Copy link
Owner Author

vic commented Dec 17, 2025

Ok, now I'm thinking to re-work the aspects definition, I think the problem is we have a custom type of function-to-aspect. Aspects are modules anyways and modules in nix are "attrset or function-to-attrset", maybe we could explore removing our function-to-aspect, and just make the "context" available as part of the aspect-module _module.args. this is how den.base.host modules work. perhaps we should explore that route.

@vic
Copy link
Owner Author

vic commented Dec 17, 2025

Hm, but the problem araises from deeply nested modules, via .provides. not so much on aspect-definition itself.

Alb-O and others added 2 commits December 18, 2025 15:04
When merging aspect configs across scopes (e.g. bar = config.foo), the
modules and resolve options were incorrectly merging pre-computed values
from individual scopes instead of recomputing from the merged config.

The fix uses custom type merge functions that always recompute from the
final merged config, ensuring resolved modules reflect all merged aspect
definitions.
* Revert "Split tests (#19)"

This reverts commit 72ffc00.

* update README with correct test commands (#22)

* Revert "Revert "Split tests (#19)""

This reverts commit 1df56b4.

* test merging aspects

* fix: use custom merge functions for modules and resolve options (#23)

When merging aspect configs across scopes (e.g. bar = config.foo), the
modules and resolve options were incorrectly merging pre-computed values
from individual scopes instead of recomputing from the merged config.

The fix uses custom type merge functions that always recompute from the
final merged config, ensuring resolved modules reflect all merged aspect
definitions.

---------

Co-authored-by: Albert O'Shea <albertoshea2@gmail.com>
@vic vic mentioned this pull request Dec 18, 2025
@vic vic closed this Dec 18, 2025
@vic vic deleted the provider branch December 18, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants