Skip to content

feature/AB#32216-BuildAIBase#2100

Draft
JamesPasta wants to merge 6 commits intodevfrom
feature/AB#32216-BuildAIBaseModule
Draft

feature/AB#32216-BuildAIBase#2100
JamesPasta wants to merge 6 commits intodevfrom
feature/AB#32216-BuildAIBaseModule

Conversation

@JamesPasta
Copy link
Collaborator

No description provided.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

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

Introduces a new Unity.AI module scaffold into the Unity GrantManager solution, wiring initial project references and EF Core configuration to prepare for future AI-related features.

Changes:

  • Added new Unity.AI module projects (Domain.Shared, Application.Contracts, Application, Web) with localization + permissions scaffolding.
  • Hooked AI model configuration into the tenant DbContext and added project references from the main app to the new module.
  • Added an EF Core migration intended to establish an AI schema.

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Unity.GrantManager.Web.csproj Adds reference to AI Web module project
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Unity.GrantManager.EntityFrameworkCore.csproj Adds reference to AI Application project
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/GrantManagerDbContextModelSnapshot.cs Updates host model snapshot (includes non-AI model changes)
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.cs New migration to ensure AI schema
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.Designer.cs Auto-generated migration designer/model
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/EntityFrameworkCore/GrantTenantDbContext.cs Calls modelBuilder.ConfigureAI() for tenant DB
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Unity.AI.Web.csproj New AI Web layer project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Properties/launchSettings.json Local launch profile for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/_ViewImports.cshtml Razor imports for AI web pages
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xsd Fody weaver schema for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xml Fody weaver config for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebModule.cs ABP module definition for AI Web
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebAutoMapperProfile.cs Placeholder AutoMapper profile for AI Web
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Unity.AI.Shared.csproj New AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AIResource.cs Defines AI localization resource
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AI/en.json English localization strings for AI permissions
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xsd Fody weaver schema for AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xml Fody weaver config for AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AISharedModule.cs ABP module definition for AI Domain.Shared
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AIErrorCodes.cs Placeholder error code constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Unity.AI.Application.csproj New AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xsd Fody weaver schema for AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xml Fody weaver config for AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/IAIDbContext.cs Defines EF Core DbContext interface for AI
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIEntityFrameworkCoreModule.cs Registers AI DbContext in a dedicated ABP module
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContextModelCreatingExtensions.cs Adds ConfigureAI() model builder extension
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContext.cs AI AbpDbContext implementation
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Domain/AIDbProperties.cs AI schema/connection string constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationModule.cs ABP module definition for AI Application
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationAutoMapperProfile.cs Placeholder AutoMapper profile for AI Application
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIAppService.cs Base ApplicationService class with AI localization
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Unity.AI.Application.Contracts.csproj New AI Application.Contracts project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissions.cs Defines AI permission constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissionDefinitionProvider.cs Registers AI permissions with ABP
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xsd Fody weaver schema for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xml Fody weaver config for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIRemoteServiceConsts.cs Remote service constants for AI
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIApplicationContractsModule.cs ABP module definition for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/common.props Module-wide build properties + Fody package refs
applications/Unity.GrantManager/modules/Unity.AI/NuGet.Config Module-local NuGet config
applications/Unity.GrantManager/modules/Unity.AI/.prettierrc Module-local Prettier settings
applications/Unity.GrantManager/modules/Unity.AI/.gitignore Module-local gitignore
applications/Unity.GrantManager/modules/Unity.AI/.gitattributes Linguist vendoring for libs
applications/Unity.GrantManager/Unity.GrantManager.sln Adds AI projects to the solution

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +12 to +15
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(name: "AI");
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

AISchema is created as a HostMigration for GrantManagerDbContext (Default connection string), but the AI module’s AIDbProperties.ConnectionStringName is Tenant and GrantTenantDbContext is calling modelBuilder.ConfigureAI(). If AI tables are intended to live in the tenant database (like Payments/Flex/Reporting), this migration should be generated under Migrations/TenantMigrations (or the AI schema/connection string should be adjusted to match the host DB).

Copilot uses AI. Check for mistakes.
Comment on lines +28 to 30
<ProjectReference Include="..\..\modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj" />
<ProjectReference Include="..\..\modules\Unity.SharedKernel\Unity.SharedKernel.csproj" />
<ProjectReference Include="..\..\modules\Unity.Theme.UX2\src\Unity.Theme.UX2\Unity.AspNetCore.Mvc.UI.Theme.UX2.csproj" /></ItemGroup>
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

The solution references Unity.AI.Web, but ABP modules are only activated when included via [DependsOn] from the root module (e.g., GrantManagerWebModule). If this is meant to be enabled at runtime, add AIWebModule to the root module dependency list; otherwise this reference will compile but none of the module configuration/services will be registered.

Copilot uses AI. Check for mistakes.
typeof(AIApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule),
typeof(AbpTenantManagementDomainModule)
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

AIEntityFrameworkCoreModule (which registers AIDbContext) is never pulled into the module dependency graph (no [DependsOn] references found). This means AIDbContext won’t be registered unless another root module explicitly depends on it. Consider adding typeof(AIEntityFrameworkCoreModule) to this module’s [DependsOn] list (pattern used by ReportingApplicationModule) or registering the DbContext directly in AIApplicationModule.

Suggested change
typeof(AbpTenantManagementDomainModule)
typeof(AbpTenantManagementDomainModule),
typeof(AIEntityFrameworkCoreModule)

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +11
public static class AIPermissions
{
public const string GroupName = "AI";

public static class Default
{
public const string Management = GroupName + ".Management";
}
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

For consistency with other modules’ permission constants (e.g., NotificationsPermissions, FlexPermissions, ReportingPermissions), add a GetAll() helper that returns ReflectionHelper.GetPublicConstantsRecursively(typeof(AIPermissions)). This is commonly used for permission seeding/registration and keeps the module aligned with existing patterns.

Copilot uses AI. Check for mistakes.
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 41 out of 42 changed files in this pull request and generated 3 comments.


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

You can also share your feedback on Copilot code review. Take the survey.

EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.AI.Application", "modules\Unity.AI\src\Unity.AI.Application\Unity.AI.Application.csproj", "{7CF9D364-2018-4199-879B-371F6E1AC58B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}"
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

In the solution file, Unity.AI.Web is added with the legacy C# project type GUID {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}. Most other SDK-style projects in this solution (including other *.Web modules like Unity.Payments.Web) use {9A19103F-16F7-4668-BE54-9A1E7A4F7556}; consider aligning Unity.AI.Web to the SDK-style GUID to avoid Visual Studio/solution tooling inconsistencies.

Suggested change
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}"

Copilot uses AI. Check for mistakes.
@JamesPasta JamesPasta marked this pull request as draft March 6, 2026 21:26
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

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 49 out of 50 changed files in this pull request and generated 4 comments.


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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +9 to +10
using Unity.GrantManager.Permissions;
using Unity.AI.Permissions;
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

using Unity.GrantManager.Permissions; appears to be unused after switching the permission check to AIPermissions.... Please remove the unused using to keep the file warning-free and avoid implying GrantApplicationPermissions is still involved here.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +33
public const string GroupName = "AI";

public static class Default
{
public const string Management = GroupName + ".Management";
public const string GroupName = "AI";

public static class Reporting
{
public const string Default = GroupName + ".Reporting";
}

public static class ApplicationAnalysis
{
public const string Default = GroupName + ".ApplicationAnalysis";
}

public static class AttachmentSummary
{
public const string Default = GroupName + ".AttachmentSummary";
}

public static class ScoringAssistant
{
public const string Default = GroupName + ".ScoringAssistant";
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

AIPermissions currently defines GroupName both at the top-level and again inside the nested Default class, and the nested Default container leads to redundant usage like AIPermissions.Default.Reporting.Default. Consider flattening to AIPermissions.Reporting.Default (similar to other modules) and removing the duplicate GroupName to avoid name hiding/confusion as the module grows.

Copilot uses AI. Check for mistakes.
"culture": "en",
"texts": {
"Permission:AI": "AI",
"Permission:AI.Default": "AI Management",
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

The localization key Permission:AI.Default is defined, but no corresponding permission appears to be registered (the provider only adds Reporting/ApplicationAnalysis/AttachmentSummary/ScoringAssistant). Either add a permission that uses this key (e.g., a module-level default/management permission) or remove the unused localization entry to prevent dead strings and confusion.

Suggested change
"Permission:AI.Default": "AI Management",

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +37
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));


aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default ,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

Formatting issues in this provider (extra indentation inside Define, stray space before a comma in AttachmentSummary.Default ,, inconsistent alignment) make diffs noisier and can trip style analyzers. Please normalize indentation and whitespace to match other *PermissionDefinitionProvider implementations in the repo.

Suggested change
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));
aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default ,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));
aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

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.

2 participants