Skip to content

Apply LPA findings + VSA tier-4 restructure with DI-seam#570

Merged
jschick04 merged 2 commits into
jschick/library-modal-rewirefrom
jschick/library-lpa
Jun 4, 2026
Merged

Apply LPA findings + VSA tier-4 restructure with DI-seam#570
jschick04 merged 2 commits into
jschick/library-modal-rewirefrom
jschick/library-lpa

Conversation

@jschick04
Copy link
Copy Markdown
Collaborator

Stacked on #567 (auto-retargets to main when #567 merges).

Phase A — LPA findings (commit b9a3bb1)

  • Internalize 4 types whose only consumers are intra-assembly: FilterCompiler, ResolvedEventExtensions, EventLogDataQueryExtensions, ProviderSource
  • Seal 3 Provider models: EventModel, MessageModel, ProviderDetails
  • Drop EventLogExpert.Runtime IVT from DatabaseTools.csproj (no longer needed after factory move)
  • Relocate 4 EventLogData_GetEventValues_* tests Runtime.Tests → Filtering.Tests/EventData/EventLogDataQueryExtensionsTests.cs (matches the SUT's assembly)
  • Refresh FilterCompiler XML doc post-internalize

Phase B — VSA tier-4 restructure with DI-seam (commit d95e594)

  • Drop 2 dead friend grants (Logging→Eventing, Provider→Eventing)
  • Rename 4 Helper classes to intent-based names:
    • RegexHelperFilterRegexFactory (EventDbTool/Commands/Support)
    • CommandLineToArgvWHelperWin32CommandLineParser (stays public — host cross-asm consumer)
    • FilePickerHelperWin32FileDialogService
    • FolderPickerHelperWinUiFolderPicker
  • Provider Models/Resolution/ (3 files + 22-file consumer namespace cascade)
  • DatabaseTools full-slice reorg (24 file moves into 5 per-operation slices + Common/Ipc + Common/Operations) with full DI-seam:
    • New EventLogExpert.DatabaseTools.DependencyInjection.AddDatabaseToolsServices() extension using TryAddSingleton<IDatabaseToolsOperationFactory, DatabaseToolsOperationFactory>
    • Factory + impl moved from Runtime to DatabaseTools (internal sealed impl + public interface)
    • OperationBase + 5 *Operation classes internalized
    • EventDbTool 5 commands refactored to consume factory via DI instead of new (was: new XOperation(req), now: sp.GetRequiredService<IDatabaseToolsOperationFactory>().Create(req))
    • 51-file consumer namespace cascade (Contracts→Common.Ipc, Operations→Common.Operations, Runtime.DatabaseTools→DatabaseTools.Common.Operations)
  • Host Adapters folder renames: ClipboardAdapter/Clipboard/, FilePickerAdapter/FilePicker/; ClipboardServiceMauiClipboardService; MAUI namespace collisions resolved via using MauiClipboard = ...; / using MauiFilePicker = ...; aliases
  • TitleProvider → internal sealed (DI-resolved intra-assembly only)
  • ToggleWithLabel.razorFilterEditor/Rows/ (placed near sole consumer)
  • UiServiceCollectionExtensionsMenuServiceCollectionExtensions (matches Menu slice ownership)

Round-2 review fixes (folded into Phase B via amend)

Addressed §2D panel findings before PR-open:

  • EventResolverBase.Dispose — restored { return; } in double-dispose guard (regression from PR-C namespace cascade)
  • RuntimeServiceCollectionExtensionsAddSingleton<IDatabaseToolsService>TryAddSingleton at both call sites (idempotency parity); refactored to C# 14 extension(IServiceCollection services) { ... } block syntax matching established 8-file repo idiom
  • _Imports.razorUI.Inputs restored to alphabetical position
  • MauiFilePickerService — stale doc cref FilePickerHelperWin32FileDialogService
  • ProviderDetailsTests.csgit mv Models/ → Resolution/ (folder matches source rename)

Out of scope (deferred)

Test verification

  • Build: 0 errors, 0 warnings (all 12 projects, debug)
  • Unit: 2787/2787 (Runtime 1081 / UI 478 / Filtering 872 / Eventing 230 / Provider 35 / Provider.Database 43 / Windows 40 / EventDbTool 8)
  • Integration (./scripts/run-tests.ps1): runtime 164 / eventing 303 (2 pre-existing skips)

…s/EventLogDataQueryExtensions/ProviderSource, seal Provider models (EventModel/MessageModel/ProviderDetails), drop Runtime IVT from DatabaseTools, move 4 GetEventValues tests from Runtime.Tests to Filtering.Tests, refresh FilterCompiler XML doc post-internalize
Copy link
Copy Markdown
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 PR applies LPA findings (tightening visibility/sealing where types are only used intra-assembly) and performs a tier-4 VSA restructure that introduces a DI seam for DatabaseTools, alongside a broad namespace/folder reorganization and helper renames. It updates downstream consumers (UI, EventDbTool, elevation helper, tests, and docs) to use the new namespaces and factory-based construction patterns.

Changes:

  • Internalize/seal several types across Filtering/Provider/DatabaseTools and update tests accordingly (including relocating GetEventValues tests to Filtering.Tests).
  • Restructure DatabaseTools into operation “slices”, introduce AddDatabaseToolsServices() DI registration, and refactor EventDbTool commands to create operations via IDatabaseToolsOperationFactory.
  • Rename/move Windows/MAUI adapter helpers (clipboard/file/folder pickers, Win32 argv parsing) and update references across code + documentation.

Reviewed changes

Copilot reviewed 116 out of 118 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/EventLogExpert.Windows.Tests/Win32CommandLineParserTests.cs Updates tests to renamed/moved Win32 command line parser type/namespace.
tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EventLogStoreTests.cs Removes GetEventValues_* tests from Runtime.Tests after relocating them.
tests/Unit/EventLogExpert.Runtime.Tests/DependencyInjection/RuntimeServiceCollectionExtensionsTests.cs Adjusts test imports for new DatabaseTools namespaces.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/StreamingTraceLoggerTests.cs Updates references from DatabaseTools.Contracts to new common operations namespace.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/Elevation/RegexJsonConverterTests.cs Updates IPC converter namespace usage after DatabaseTools IPC move.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/Elevation/IpcRequestRoundTripTests.cs Updates request type namespaces after DatabaseTools slice split.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/Elevation/IpcEnvelopeRoundTripTests.cs Updates envelope/progress/result namespaces after IPC/operations split.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/Elevation/ElevatedDatabaseToolsRunnerTests.cs Updates runner test imports to new DatabaseTools slice namespaces.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/DatabaseToolsServiceTests.cs Updates service tests to new request/operations namespaces.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/DatabaseToolsOperationFactoryTests.cs Updates factory tests for new Common.Operations location.
tests/Unit/EventLogExpert.Provider.Tests/Resolution/ProviderDetailsTests.cs Moves tests to Resolution namespace after Provider model folder rename.
tests/Unit/EventLogExpert.Provider.Database.Tests/Serialization/ProviderJsonContextTests.cs Updates Provider model namespace to Provider.Resolution.
tests/Unit/EventLogExpert.Provider.Database.Tests/Maintenance/ProviderDetailsMergerTests.cs Updates Provider model namespace to Provider.Resolution.
tests/Unit/EventLogExpert.Filtering.Tests/EventData/EventLogDataQueryExtensionsTests.cs Adds relocated GetEventValues tests into Filtering.Tests (aligned with internalized SUT).
tests/Unit/EventLogExpert.Eventing.Tests/Resolvers/EventResolverBaseTests.cs Updates Provider model namespace to Provider.Resolution.
tests/Unit/EventLogExpert.EventDbTool.Tests/FilterRegexFactoryTests.cs Renames regex helper tests to match new FilterRegexFactory location/name.
tests/Shared/EventLogExpert.Eventing.TestUtils/EventUtils.cs Updates Provider model namespace to Provider.Resolution.
tests/Shared/EventLogExpert.Eventing.TestUtils/DatabaseTestUtils.cs Updates Provider model namespace to Provider.Resolution.
tests/Integration/EventLogExpert.Provider.Database.IntegrationTests/Context/ProviderDbContextTests.cs Refines V2 upgrade tests and adjusts assertions/structure around schema edge cases.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/Resolvers/VersatileEventResolverTests.cs Removes old Provider.Models import and uses Provider.Resolution.
tests/Integration/EventLogExpert.ElevationHelper.IntegrationTests/OperationsEndToEndTests.cs Updates imports to new DatabaseTools slice namespaces for end-to-end coverage.
tests/Integration/EventLogExpert.ElevationHelper.IntegrationTests/DestructiveRecoveryTests.cs Updates imports to new DatabaseTools slice namespaces.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Sources/ProviderSourceTests.cs Updates ProviderSource reference to new Common.Operations location.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Operations/UpgradeDatabaseOperationTests.cs Updates imports to operation-specific namespace slice.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Operations/ShowProvidersOperationTests.cs Updates imports to operation-specific namespace slice.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Operations/MergeDatabaseOperationTests.cs Updates imports to operation-specific namespace slice.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Operations/DiffDatabaseOperationTests.cs Updates imports to operation-specific namespace slice.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Operations/CreateDatabaseOperationTests.cs Updates imports to operation-specific namespace slice.
src/EventLogExpert/Platforms/Windows/WinUiFolderPicker.cs Renames folder picker helper to intent-based name.
src/EventLogExpert/Platforms/Windows/Win32FileDialogService.cs Renames file picker helper to intent-based name.
src/EventLogExpert/Platforms/Windows/Activation/ActivationArgsExtractor.cs Updates activation parsing to use renamed/moved Win32 argv parser.
src/EventLogExpert/DependencyInjection/MauiProgramExtensions.cs Updates adapter namespaces and renames clipboard service registration.
src/EventLogExpert/Adapters/Window/TitleProvider.cs Internalizes/seals TitleProvider for intra-assembly DI-only usage.
src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Resolves MAUI type-name collisions via aliasing Microsoft.Maui.Storage.FilePicker.
src/EventLogExpert/Adapters/FilePickerAdapter/MauiFolderPickerService.cs Removes old adapter file after folder/namespace reorg.
src/EventLogExpert/Adapters/FilePicker/MauiFolderPickerService.cs Adds moved folder picker adapter under new folder/namespace.
src/EventLogExpert/Adapters/FilePicker/MauiFilePickerService.cs Updates namespace and delegates to renamed Win32 dialog service.
src/EventLogExpert/Adapters/Clipboard/MauiClipboardService.cs Renames clipboard adapter type/namespace and aliases MAUI Clipboard to avoid collisions.
src/EventLogExpert.WindowsPlatform/Activation/Win32CommandLineParser.cs Moves/renames Win32 argv parsing helper into Activation namespace.
src/EventLogExpert.UI/Menu/MenuServiceCollectionExtensions.cs Renames DI extension class to reflect Menu slice ownership.
src/EventLogExpert.UI/FilterEditor/Rows/ToggleWithLabel.razor.css Adds styling for relocated ToggleWithLabel component.
src/EventLogExpert.UI/FilterEditor/Rows/ToggleWithLabel.razor.cs Moves ToggleWithLabel backing class into FilterEditor/Rows namespace.
src/EventLogExpert.UI/FilterEditor/Rows/ToggleWithLabel.razor Adds relocated ToggleWithLabel component markup.
src/EventLogExpert.UI/DatabaseTools/Tabs/UpgradeDatabaseTab.razor.cs Updates DatabaseTools request namespaces for Upgrade tab.
src/EventLogExpert.UI/DatabaseTools/Tabs/UpgradeDatabaseTab.razor Updates @using to operation-specific namespace.
src/EventLogExpert.UI/DatabaseTools/Tabs/ShowProvidersTab.razor.cs Updates DatabaseTools request namespaces for Show Providers tab.
src/EventLogExpert.UI/DatabaseTools/Tabs/ShowProvidersTab.razor Updates @using to operation-specific namespace.
src/EventLogExpert.UI/DatabaseTools/Tabs/MergeDatabaseTab.razor.cs Updates DatabaseTools request namespaces for Merge tab.
src/EventLogExpert.UI/DatabaseTools/Tabs/MergeDatabaseTab.razor Updates @using and minor markup adjustments for ValueSelect usage.
src/EventLogExpert.UI/DatabaseTools/Tabs/DiffDatabasesTab.razor.cs Updates DatabaseTools request namespaces for Diff tab.
src/EventLogExpert.UI/DatabaseTools/Tabs/DiffDatabasesTab.razor Updates @using to operation-specific namespace.
src/EventLogExpert.UI/DatabaseTools/Tabs/DatabaseToolsTabBase.cs Updates common operations imports after DatabaseTools slice restructure.
src/EventLogExpert.UI/DatabaseTools/Tabs/CreateDatabaseTab.razor.cs Updates DatabaseTools request namespaces for Create tab.
src/EventLogExpert.UI/DatabaseTools/Tabs/CreateDatabaseTab.razor Updates @using to operation-specific namespace.
src/EventLogExpert.UI/DatabaseTools/DatabaseToolsLogView.razor.cs Updates log view imports to new common operations namespace.
src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs Refactors runtime DI to call AddDatabaseToolsServices() and use TryAddSingleton for idempotency.
src/EventLogExpert.Runtime/DatabaseTools/StreamingTraceLogger.cs Updates imports to new common operations namespace.
src/EventLogExpert.Runtime/DatabaseTools/IDatabaseToolsService.cs Updates public facade to reference new operation/request namespaces.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/IElevatedHelperProcessHost.cs Updates doc cref for outcome enum after namespace move.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/IElevatedDatabaseToolsRunner.cs Updates imports to new operation/request namespaces.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/ElevatedDatabaseToolsRunner.cs Updates imports to new IPC/operations namespaces.
src/EventLogExpert.Runtime/DatabaseTools/DatabaseToolsService.cs Updates imports to new operation/request namespaces.
src/EventLogExpert.Provider/Resolution/ProviderDetails.cs Moves ProviderDetails to Resolution namespace and seals the model.
src/EventLogExpert.Provider/Resolution/MessageModel.cs Moves MessageModel to Resolution namespace and seals the model.
src/EventLogExpert.Provider/Resolution/EventModel.cs Moves EventModel to Resolution namespace and seals the model.
src/EventLogExpert.Provider/Lookup/IProviderDetailsLookup.cs Updates Provider model namespace usage.
src/EventLogExpert.Provider/EventLogExpert.Provider.csproj Removes unneeded friend assembly grant to Eventing.
src/EventLogExpert.Provider.Database/Serialization/ProviderJsonContext.cs Updates Provider model namespace usage.
src/EventLogExpert.Provider.Database/Maintenance/ProviderDetailsMerger.cs Updates Provider model namespace usage.
src/EventLogExpert.Provider.Database/Context/ProviderDbContext.cs Updates nameof(...) references after Provider model namespace move.
src/EventLogExpert.Logging/EventLogExpert.Logging.csproj Removes unneeded friend assembly grant to Eventing.
src/EventLogExpert.Filtering/FilterCompiler.cs Internalizes FilterCompiler and refreshes doc text to match new visibility.
src/EventLogExpert.Filtering/EventData/EventLogDataQueryExtensions.cs Internalizes EventLogDataQueryExtensions.
src/EventLogExpert.Filtering/Evaluation/ResolvedEventExtensions.cs Internalizes ResolvedEventExtensions.
src/EventLogExpert.Eventing/Resolvers/EventResolverBase.cs Updates Provider model namespace usage.
src/EventLogExpert.Eventing/Resolvers/EventResolver.cs Removes old Provider.Models import and uses Provider.Resolution.
src/EventLogExpert.Eventing/PublisherMetadata/MtaProviderSource.cs Updates Provider model namespace usage.
src/EventLogExpert.Eventing/PublisherMetadata/EventMessageProvider.cs Updates Provider model namespace usage.
src/EventLogExpert.EventDbTool/Program.cs Adds DatabaseTools DI registration for operation factory.
src/EventLogExpert.EventDbTool/Commands/UpgradeDatabaseCommand.cs Refactors to create operations via DI factory instead of newing operation types.
src/EventLogExpert.EventDbTool/Commands/Support/FilterRegexFactory.cs Renames/moves regex helper into commands support slice.
src/EventLogExpert.EventDbTool/Commands/ShowCommand.cs Uses FilterRegexFactory and DI-created operations.
src/EventLogExpert.EventDbTool/Commands/MergeDatabaseCommand.cs Uses DI-created operations via factory.
src/EventLogExpert.EventDbTool/Commands/DiffDatabaseCommand.cs Uses DI-created operations via factory.
src/EventLogExpert.EventDbTool/Commands/CreateDatabaseCommand.cs Uses FilterRegexFactory and DI-created operations.
src/EventLogExpert.ElevationHelper/ProgramEntry.cs Updates imports to new IPC/operations namespaces and restructures helper method placement.
src/EventLogExpert.ElevationHelper/ProbeMode.cs Updates imports to new IPC namespace.
src/EventLogExpert.ElevationHelper/OperationDispatcher.cs Updates imports to new IPC/operations namespaces.
src/EventLogExpert.ElevationHelper/IpcSinks.cs Updates imports to new IPC/operations namespaces.
src/EventLogExpert.ElevationHelper/IpcEnvelopeReader.cs Updates imports to new IPC namespace.
src/EventLogExpert.ElevationHelper/DestructiveRecovery.cs Updates imports to new IPC/operations/request namespaces.
src/EventLogExpert.DatabaseTools/UpgradeDatabase/UpgradeDatabaseRequest.cs Moves request record to operation-specific namespace.
src/EventLogExpert.DatabaseTools/UpgradeDatabase/UpgradeDatabaseOperation.cs Moves operation to operation-specific namespace and internalizes implementation.
src/EventLogExpert.DatabaseTools/ShowProviders/ShowProvidersRequest.cs Moves request record to operation-specific namespace.
src/EventLogExpert.DatabaseTools/ShowProviders/ShowProvidersOperation.cs Moves operation to operation-specific namespace and internalizes implementation.
src/EventLogExpert.DatabaseTools/MergeDatabase/MergeDatabaseRequest.cs Moves request record to operation-specific namespace.
src/EventLogExpert.DatabaseTools/MergeDatabase/MergeDatabaseOperation.cs Moves operation to operation-specific namespace and internalizes implementation.
src/EventLogExpert.DatabaseTools/EventLogExpert.DatabaseTools.csproj Removes Runtime friend grant (retains test friend grant).
src/EventLogExpert.DatabaseTools/DiffDatabase/DiffDatabaseRequest.cs Moves request record to operation-specific namespace.
src/EventLogExpert.DatabaseTools/DiffDatabase/DiffDatabaseOperation.cs Moves operation to operation-specific namespace and internalizes implementation.
src/EventLogExpert.DatabaseTools/DependencyInjection/DatabaseToolsServiceCollectionExtensions.cs Adds public DI extension to register the operation factory idempotently.
src/EventLogExpert.DatabaseTools/CreateDatabase/CreateDatabaseRequest.cs Moves request record to operation-specific namespace.
src/EventLogExpert.DatabaseTools/CreateDatabase/CreateDatabaseOperation.cs Moves operation to operation-specific namespace and internalizes implementation.
src/EventLogExpert.DatabaseTools/Common/Operations/ProviderSource.cs Moves provider loading helper to Common.Operations and internalizes it.
src/EventLogExpert.DatabaseTools/Common/Operations/OperationBase.cs Moves operation base to Common.Operations and internalizes it.
src/EventLogExpert.DatabaseTools/Common/Operations/IDatabaseToolsOperationFactory.cs Moves factory interface to DatabaseTools and makes it public.
src/EventLogExpert.DatabaseTools/Common/Operations/IDatabaseToolsOperation.cs Moves operation contract to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Operations/DatabaseToolsResult.cs Moves result type to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Operations/DatabaseToolsProgress.cs Moves progress type to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Operations/DatabaseToolsOutcome.cs Moves outcome enum to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Operations/DatabaseToolsOperationFactory.cs Moves factory implementation to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Operations/DatabaseToolsLogEntry.cs Moves log entry type to Common.Operations.
src/EventLogExpert.DatabaseTools/Common/Ipc/RegexJsonConverter.cs Moves IPC converter to Common.Ipc namespace.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcSerializer.cs Moves IPC serializer to Common.Ipc namespace.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcRequest.cs Moves IPC request base to Common.Ipc namespace.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcJsonContext.cs Moves IPC source-gen context to Common.Ipc namespace.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcEnvelope.cs Moves IPC envelope base to Common.Ipc namespace and imports outcome type.
docs/Explorer-Context-Menu.md Updates smoke recipe references to renamed CLI parsing test.

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

…ing, rename 4 Helper classes to intent-based names, split Provider/Models into Resolution slice, reorganize DatabaseTools into per-operation slices with full DI-seam (factory+interface moved to DatabaseTools, OperationBase+5 ops internalized, IDatabaseToolsOperationFactory publicized), refactor EventDbTool commands to use factory via DI, rename host Adapters ClipboardAdapter/FilePickerAdapter folders + ClipboardService->MauiClipboardService, internalize TitleProvider, move ToggleWithLabel to FilterEditor/Rows, rename UiServiceCollectionExtensions->MenuServiceCollectionExtensions
Copy link
Copy Markdown
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 116 out of 118 changed files in this pull request and generated no new comments.

@jschick04 jschick04 marked this pull request as ready for review June 4, 2026 03:48
@jschick04 jschick04 requested a review from a team as a code owner June 4, 2026 03:48
@jschick04 jschick04 merged commit b307f30 into jschick/library-modal-rewire Jun 4, 2026
2 checks passed
@jschick04 jschick04 deleted the jschick/library-lpa branch June 4, 2026 03:48
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