Repository navigation
refactor(api): re-architect Arius.Api into vertical slices (Features + Shared) - #248
Conversation
Vertical-slice layout like Arius.Core: one file per endpoint (named after the endpoint) plus a DTO file per endpoint under Features/<Area>/, and cross-area infrastructure under Shared/. JobsHub becomes a thin dispatcher whose method bodies live in the feature files; AppDatabase is split into one partial file per table. Behaviour-preserving: namespaces and type names are unchanged, so no file outside src/Arius.Api is touched and the test projects run as they were. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…olders Namespaces become Arius.Api.Features.<Area> and Arius.Api.Shared.<Area>. Outside the Api only using directives and qualified names change (test projects and the fake test host); no test logic or file moves. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Arius.Api.Tests and Arius.Api.Integration.Tests move into Features/<Area> and Shared/<Area> folders with matching namespaces. No test logic changes and nothing under src/Arius.Api is touched; same 108 + 61 tests pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…uery The StreamContainers hub method called IBlobServiceFactory directly, bypassing Core's features. It now sends ContainerNamesQuery through a repository-less mediator that RepositoryProviderRegistry builds once. Core gains AddAriusWithoutRepository(): the real ContainerNamesQuery handler plus throwing stand-ins for the repository-bound requests (the mediator resolves every handler on first use), so no repository services or local state are created. The fake test host scripts the query. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…Service The stats endpoint resolved Core's ISnapshotService to fingerprint its cache entry. Add the LatestSnapshotVersionQuery feature to Core and send that instead, so the Api reaches Core only through IMediator. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Arius.Architecture.Tests now loads Arius.Api and checks that internal types stay within their namespace subtree (opt out with the Api's own [SharedWithinAssembly]), feature areas do not depend on each other, Shared does not depend on Features, and the Api reaches Core only through IMediator (AzureRepositoryCoreComposer is the one storage seam). AriusApiHost and JobsHub are the composition roots. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- derive the forbidden Core services from every public interface under Arius.Core.Shared instead of a hand-written list - check only types in Arius.Api namespaces (not Mediator-generated wiring) - name the real ArchUnitNET blind spot: async iterator bodies - the fake host reuses Core's AddAriusWithoutRepository stand-ins - clean up the repository-less provider test's temp database; fix comments Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Record the decision, rewrite the Api agent contract's layout section, and update the design docs, glossary and Core query docs for the new paths, the repository-less provider and LatestSnapshotVersionQuery. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 255 files, which is 155 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #248 +/- ##
==========================================
+ Coverage 78.57% 81.63% +3.06%
==========================================
Files 184 260 +76
Lines 10886 10871 -15
Branches 1553 1557 +4
==========================================
+ Hits 8554 8875 +321
+ Misses 1967 1626 -341
- Partials 365 370 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Each endpoint is now a class with constructor-injected services and an instance Handle method (REPR style). Endpoints are found by an assembly scan, replacing the hand-written Map call lists and route groups. The route delegate stays a forwarding lambda, so the OpenAPI document is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Each hub method's behaviour is an IHubHandler class with constructor- injected services, which JobsHub receives as a method-injected service. JobsHub no longer has constructor dependencies. The handlers are public because they appear in the public hub's method signatures. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…atures Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SignalR infers a service only for a hub-method parameter without attributes. The compiler put a nullability attribute on StreamEntries' handler parameter, so it was expected as a sixth wire argument and every call failed. Mark all handler parameters explicitly and guard it with an architecture rule. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Raises Arius.Api line coverage from 74% to 91% (Arius.Api.Tests + Arius.Api.Integration.Tests). The scripted Core gains a read scenario (list, snapshots, statistics, latest version) so browse, snapshot and statistics features can be driven offline. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…eAsync IEndpoint cannot declare Handle because every endpoint binds its own wire parameters and returns its own type, so the convention is enforced by an architecture rule: one public instance method, named HandleAsync when it returns a Task, ValueTask or IAsyncEnumerable and Handle otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SearchAll buffered each repository's hits before yielding them (C# forbids yield inside try/catch). Guard each enumerator step instead, so hits stream while a repository that can't be opened or listed is still skipped; a cancelled search now stops instead of trying every remaining repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only an endpoint's own Map lambda calls Handle/HandleAsync, and minimal-API binding and OpenAPI inference read that lambda, not Handle, so it need not be public. With no public surface left to police, drop the Endpoints_Should_Expose_A_Single_Handle_Method rule; the Handle/HandleAsync naming stays a convention in the Api AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review findings are reported for the API feature reorganization.
No open issues 🎉
What changed in this PR
This PR reorganizes Arius.Api around feature areas and shared infrastructure, matching Core’s vertical-slice structure while preserving existing REST and SignalR contracts.
Changes:
- Extracts REST endpoints and hub handlers into injected feature classes, with assembly-based registration and a thin
JobsHubdispatcher. - Routes container discovery and latest-snapshot lookup through Core’s Mediator features, and splits database operations into focused partial files.
- Aligns tests and documentation with the new layout and adds composition, endpoint, and hub coverage.
| File | Description |
|---|---|
src/Arius.Core/ServiceCollectionExtensions.cs |
Registers latest-version queries and repository-less handlers. |
src/Arius.Core/Features/LatestSnapshotVersionQuery/LatestSnapshotVersionQuery.cs |
Adds lightweight latest-snapshot lookup. |
src/Arius.Core/AGENTS.md |
Documents repository-less handler registration. |
src/Arius.Core.Tests/ServiceCollectionExtensionsTests.cs |
Tests repository-less registration and container listing. |
src/Arius.Core.Tests/Features/LatestSnapshotVersionQuery/LatestSnapshotVersionQueryHandlerTests.cs |
Tests newest-snapshot and empty-repository results. |
src/Arius.Cli.Tests/TestSupport/CliHarness.cs |
Registers the new query substitute. |
src/Arius.Architecture.Tests/DependencyTests.cs |
Includes Api in handler-boundary checks. |
src/Arius.Architecture.Tests/Arius.Architecture.Tests.csproj |
References Api for architecture checks. |
src/Arius.Api/SharedWithinAssemblyAttribute.cs |
Marks intentional internal cross-namespace sharing. |
src/Arius.Api/Shared/Jobs/RestoreApprovalRegistry.cs |
Relocates restore approval infrastructure. |
src/Arius.Api/Shared/Jobs/PersistedJobState.cs |
Relocates persisted job state and updates references. |
src/Arius.Api/Shared/Jobs/JobStateRegistry.cs |
Relocates live job tracking. |
src/Arius.Api/Shared/Jobs/JobSnapshot.cs |
Relocates job progress snapshots. |
src/Arius.Api/Shared/Jobs/JobSink.cs |
Relocates job event delivery. |
src/Arius.Api/Shared/Jobs/JobRunner.cs |
Relocates job execution and updates comments. |
src/Arius.Api/Shared/Jobs/JobFormat.cs |
Relocates formatting and marks shared access. |
src/Arius.Api/Shared/Jobs/CostEstimateDto.cs |
Extracts the shared cost-modal payload. |
src/Arius.Api/Shared/Hubs/JobsHub.cs |
Delegates hub methods to explicitly injected handlers. |
src/Arius.Api/Shared/Hosting/PeriodicTimerExtensions.cs |
Relocates the background timer helper. |
src/Arius.Api/Shared/Hosting/IHubHandler.cs |
Defines the hub-handler discovery marker. |
src/Arius.Api/Shared/Hosting/IEndpoint.cs |
Defines the endpoint mapping contract. |
src/Arius.Api/Shared/Hosting/FeatureRegistration.cs |
Discovers, registers, and maps feature classes. |
src/Arius.Api/Shared/Downloads/DownloadStaging.cs |
Relocates download staging infrastructure. |
src/Arius.Api/Shared/Composition/RepositoryProviderRegistry.cs |
Adds a registry-owned repository-less provider. |
src/Arius.Api/Shared/Composition/IRepositoryCoreComposer.cs |
Adds repository-less composition support. |
src/Arius.Api/Shared/Composition/AzureRepositoryCoreComposer.cs |
Wires production repository-less Core services. |
src/Arius.Api/Shared/Composition/AriusLogging.cs |
Relocates logging composition and marks shared access. |
src/Arius.Api/Shared/AppData/SecretProtector.cs |
Relocates secret protection. |
src/Arius.Api/Shared/AppData/Records.cs |
Relocates persistence records. |
src/Arius.Api/Shared/AppData/OptionDefaults.cs |
Relocates shared option-resolution rules. |
src/Arius.Api/Shared/AppData/JobStatuses.cs |
Relocates job status definitions. |
src/Arius.Api/Shared/AppData/AppDatabase.StatisticsCache.cs |
Extracts statistics-cache persistence. |
src/Arius.Api/Shared/AppData/AppDatabase.Schedules.cs |
Extracts schedule persistence. |
src/Arius.Api/Shared/AppData/AppDatabase.Downloads.cs |
Extracts download persistence and settings. |
src/Arius.Api/Shared/AppData/AppDatabase.Defaults.cs |
Extracts option-default persistence. |
src/Arius.Api/Shared/AppData/AppDatabase.Cost.cs |
Extracts cost-setting persistence. |
src/Arius.Api/Shared/AppData/AppDatabase.Accounts.cs |
Extracts account persistence. |
src/Arius.Api/Program.cs |
Updates composition namespace imports. |
src/Arius.Api/Features/Statistics/GetStatisticsDtos.cs |
Places statistics payloads beside their endpoint. |
src/Arius.Api/Features/Statistics/GetStatistics.cs |
Extracts statistics endpoint and uses Core version lookup. |
src/Arius.Api/Features/Snapshots/ListSnapshotsDtos.cs |
Extracts the snapshot response payload. |
src/Arius.Api/Features/Snapshots/ListSnapshots.cs |
Extracts the snapshot-list endpoint. |
src/Arius.Api/Features/Schedules/SchedulerService.cs |
Moves scheduling into its feature area. |
src/Arius.Api/Features/Schedules/ScheduleEndpoints.cs |
Keeps schedule mapping helpers area-local. |
src/Arius.Api/Features/Schedules/ScheduleDto.cs |
Extracts the schedule response payload. |
src/Arius.Api/Features/Schedules/ListSchedules.cs |
Extracts schedule listing. |
src/Arius.Api/Features/Schedules/DeleteSchedule.cs |
Extracts schedule deletion. |
src/Arius.Api/Features/Schedules/CreateScheduleDtos.cs |
Extracts the schedule creation request. |
src/Arius.Api/Features/Schedules/CreateSchedule.cs |
Extracts schedule creation. |
src/Arius.Api/Features/Restore/StartRestore.cs |
Extracts the restore-start hub handler. |
src/Arius.Api/Features/Restore/StaleApprovalSweepService.cs |
Moves stale-approval cleanup into Restore. |
src/Arius.Api/Features/Restore/SetAutoResume.cs |
Extracts auto-resume configuration handling. |
src/Arius.Api/Features/Restore/ResumeRestore.cs |
Extracts manual restore resumption. |
src/Arius.Api/Features/Restore/RestoreForwarders.cs |
Moves restore event forwarding into Restore. |
src/Arius.Api/Features/Restore/RehydrationSchedule.cs |
Moves rehydration cadence rules into Restore. |
src/Arius.Api/Features/Restore/RehydrationPollingService.cs |
Moves rehydration polling into Restore. |
src/Arius.Api/Features/Restore/DeclineRestore.cs |
Extracts restore cost rejection. |
src/Arius.Api/Features/Restore/ApproveRestore.cs |
Extracts restore cost approval. |
src/Arius.Api/Features/Repositories/UpdateRepositoryDtos.cs |
Extracts the repository update request. |
src/Arius.Api/Features/Repositories/UpdateRepository.cs |
Extracts repository updates and cache invalidation. |
src/Arius.Api/Features/Repositories/RepositoryEndpoints.cs |
Keeps repository mapping and region helpers area-local. |
src/Arius.Api/Features/Repositories/RepositoryDto.cs |
Extracts the repository response payload. |
src/Arius.Api/Features/Repositories/ListRepositories.cs |
Extracts repository listing. |
src/Arius.Api/Features/Repositories/GetRepository.cs |
Extracts repository retrieval. |
src/Arius.Api/Features/Repositories/DeleteRepository.cs |
Extracts guarded repository deletion. |
src/Arius.Api/Features/Repositories/CreateRepositoryDtos.cs |
Extracts the repository creation request. |
src/Arius.Api/Features/Repositories/CreateRepository.cs |
Extracts repository creation. |
src/Arius.Api/Features/Jobs/ResumeInfo.cs |
Places resume-state mapping in Jobs. |
src/Arius.Api/Features/Jobs/ListJobsDtos.cs |
Extracts the job-history payload. |
src/Arius.Api/Features/Jobs/ListJobs.cs |
Extracts filtered job-history listing. |
src/Arius.Api/Features/Jobs/JobViewResolver.cs |
Moves job-view resolution into Jobs. |
src/Arius.Api/Features/Jobs/GetJobWarningsDtos.cs |
Extracts the warnings response payload. |
src/Arius.Api/Features/Jobs/GetJobWarnings.cs |
Extracts job warning retrieval. |
src/Arius.Api/Features/Jobs/GetJobDtos.cs |
Extracts the job-detail payload. |
src/Arius.Api/Features/Jobs/GetJob.cs |
Extracts job-detail retrieval. |
src/Arius.Api/Features/Jobs/DetachFromJob.cs |
Extracts SignalR job-group detachment. |
src/Arius.Api/Features/Jobs/CancelJob.cs |
Extracts job cancellation handling. |
src/Arius.Api/Features/Jobs/AttachToJobDtos.cs |
Extracts the attachment-state payload. |
src/Arius.Api/Features/Jobs/AttachToJob.cs |
Extracts job attachment and state retrieval. |
src/Arius.Api/Features/Health/GetHealth.cs |
Converts health checking into a discovered endpoint. |
src/Arius.Api/Features/Filesystem/ListFilesystemDtos.cs |
Extracts directory-browsing payloads. |
src/Arius.Api/Features/Filesystem/ListFilesystem.cs |
Extracts server-side directory browsing. |
src/Arius.Api/Features/Downloads/UpdateDownloadSettings.cs |
Extracts download-setting updates. |
src/Arius.Api/Features/Downloads/StartDownloadDtos.cs |
Extracts the collected-file request payload. |
src/Arius.Api/Features/Downloads/StartDownload.cs |
Extracts download-start validation and dispatch. |
src/Arius.Api/Features/Downloads/GetPendingDownloadDtos.cs |
Extracts the pending-download payload. |
src/Arius.Api/Features/Downloads/GetPendingDownload.cs |
Extracts pending-download lookup. |
src/Arius.Api/Features/Downloads/GetDownloadsUsage.cs |
Extracts staging-usage reporting. |
src/Arius.Api/Features/Downloads/GetDownloadSettings.cs |
Extracts download-setting retrieval. |
src/Arius.Api/Features/Downloads/GetDownloadDtos.cs |
Extracts download-state payloads. |
src/Arius.Api/Features/Downloads/GetDownloadContent.cs |
Extracts file and streamed ZIP delivery. |
src/Arius.Api/Features/Downloads/GetDownload.cs |
Extracts download-state retrieval. |
src/Arius.Api/Features/Downloads/DownloadUsageDto.cs |
Extracts the staging-usage payload. |
src/Arius.Api/Features/Downloads/DownloadNaming.cs |
Moves archive naming into Downloads. |
src/Arius.Api/Features/Downloads/DownloadEndpoints.cs |
Keeps download endpoint helpers area-local. |
src/Arius.Api/Features/Downloads/DownloadCleanupService.cs |
Moves scheduled cleanup into Downloads. |
src/Arius.Api/Features/Downloads/DownloadCleaner.cs |
Moves cleanup logic into Downloads. |
src/Arius.Api/Features/Downloads/CleanupDownloads.cs |
Extracts bulk download cleanup. |
src/Arius.Api/Features/Downloads/CleanupDownload.cs |
Extracts single-download cleanup. |
src/Arius.Api/Features/Defaults/UpdateRepositoryDefaults.cs |
Extracts repository-default updates. |
src/Arius.Api/Features/Defaults/UpdateGlobalDefaults.cs |
Extracts global-default updates. |
src/Arius.Api/Features/Defaults/RepositoryDefaultsDto.cs |
Extracts the repository-default payload. |
src/Arius.Api/Features/Defaults/GlobalDefaultsDto.cs |
Extracts the global-default payload. |
src/Arius.Api/Features/Defaults/GetRepositoryDefaults.cs |
Extracts repository-default retrieval. |
src/Arius.Api/Features/Defaults/GetGlobalDefaults.cs |
Extracts global-default retrieval. |
src/Arius.Api/Features/Defaults/DefaultsEndpoints.cs |
Keeps defaults mapping helpers area-local. |
src/Arius.Api/Features/Cost/UpdateCostSettings.cs |
Extracts cost-setting updates. |
src/Arius.Api/Features/Cost/GetCostSettings.cs |
Extracts cost-setting retrieval. |
src/Arius.Api/Features/Browse/StreamEntries.cs |
Extracts repository-entry streaming. |
src/Arius.Api/Features/Browse/SearchAllDtos.cs |
Extracts the cross-repository search payload. |
src/Arius.Api/Features/Browse/SearchAll.cs |
Extracts cross-repository search streaming. |
src/Arius.Api/Features/Browse/EntryMapping.cs |
Separates entry mapping from payload declarations. |
src/Arius.Api/Features/Browse/EntryDto.cs |
Places entry and state-flag payloads in Browse. |
src/Arius.Api/Features/Archive/StartArchive.cs |
Extracts archive-start handling. |
src/Arius.Api/Features/Archive/ArchiveForwarders.cs |
Moves archive event forwarding into Archive. |
src/Arius.Api/Features/Accounts/UpdateAccountDtos.cs |
Extracts the account update request. |
src/Arius.Api/Features/Accounts/UpdateAccount.cs |
Extracts key rotation and provider invalidation. |
src/Arius.Api/Features/Accounts/StreamContainers.cs |
Lists containers through the repository-less Mediator. |
src/Arius.Api/Features/Accounts/ListAccounts.cs |
Extracts account listing. |
src/Arius.Api/Features/Accounts/GetAccount.cs |
Extracts account retrieval. |
src/Arius.Api/Features/Accounts/DeleteAccount.cs |
Extracts guarded account deletion. |
src/Arius.Api/Features/Accounts/CreateAccountDtos.cs |
Extracts the account creation request. |
src/Arius.Api/Features/Accounts/CreateAccount.cs |
Extracts account creation. |
src/Arius.Api/Features/Accounts/AccountEndpoints.cs |
Keeps account mapping helpers area-local. |
src/Arius.Api/Features/Accounts/AccountDto.cs |
Extracts the public account payload. |
src/Arius.Api/Endpoints/JobEndpoints.cs |
Removes grouped routes replaced by feature endpoints. |
src/Arius.Api/Endpoints/FilesystemEndpoints.cs |
Removes the former filesystem route container. |
src/Arius.Api/Endpoints/DefaultsEndpoints.cs |
Removes the former defaults route container. |
src/Arius.Api/Endpoints/CostSettingsEndpoints.cs |
Removes the former cost route container. |
src/Arius.Api/Endpoints/BrowseEndpoints.cs |
Removes routes split into Snapshots and Statistics. |
src/Arius.Api/Endpoints/AccountEndpoints.cs |
Removes the former account route container. |
src/Arius.Api/Contracts/JobDetailDtos.cs |
Removes payloads relocated to Jobs and Shared. |
src/Arius.Api/Contracts/Dtos.cs |
Removes centralized payloads split across features. |
src/Arius.Api/Contracts/DownloadDtos.cs |
Removes payloads relocated to Downloads. |
src/Arius.Api/AssemblyMarker.cs |
Grants architecture tests internal access. |
src/Arius.Api/AriusApiHost.cs |
Wires relocated services and automatic endpoint discovery. |
src/Arius.Api.Tests/Shared/Jobs/JobStateRegistryTests.cs |
Aligns job-registry tests with Shared. |
src/Arius.Api.Tests/Shared/Jobs/JobSinkWarningsTests.cs |
Aligns warning tests with Shared. |
src/Arius.Api.Tests/Shared/Jobs/JobSinkProgressFixesTests.cs |
Aligns progress regression tests with Shared. |
src/Arius.Api.Tests/Shared/Jobs/JobSinkEtaTests.cs |
Aligns ETA tests with Shared. |
src/Arius.Api.Tests/Shared/Jobs/JobSinkAggregateTests.cs |
Updates aggregation tests for relocated forwarders. |
src/Arius.Api.Tests/Shared/Hosting/FeatureRegistrationTests.cs |
Verifies all discovered features resolve. |
src/Arius.Api.Tests/Shared/Downloads/DownloadStagingTests.cs |
Aligns staging tests with Shared. |
src/Arius.Api.Tests/Shared/Composition/RepositoryProviderRegistryRemovalTests.cs |
Updates removal tests for the composer contract. |
src/Arius.Api.Tests/Shared/Composition/RepositoryLessProviderTests.cs |
Tests production repository-less Mediator composition. |
src/Arius.Api.Tests/Shared/Composition/AriusLoggingTests.cs |
Aligns logging tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/TempAppDatabase.cs |
Adds temporary database test support. |
src/Arius.Api.Tests/Shared/AppData/StatisticsCacheTests.cs |
Aligns cache tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/OptionDefaultsTests.cs |
Aligns option-resolution tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/LastArchiveRunTests.cs |
Aligns archive-history tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/JobLifecycleDbTests.cs |
Aligns lifecycle persistence tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/JobGuardTests.cs |
Aligns active-job guard tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/DownloadStoreTests.cs |
Aligns download persistence tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/DefaultTierMigrationTests.cs |
Aligns migration tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/DefaultsStoreTests.cs |
Aligns defaults persistence tests with Shared. |
src/Arius.Api.Tests/Shared/AppData/CostSettingsStoreTests.cs |
Aligns cost persistence tests with Shared. |
src/Arius.Api.Tests/Features/Schedules/SchedulerServiceTests.cs |
Moves scheduler tests beside their feature. |
src/Arius.Api.Tests/Features/Restore/RepresentationTests.cs |
Moves restore representation tests. |
src/Arius.Api.Tests/Features/Restore/RehydrationScheduleTests.cs |
Moves rehydration cadence tests. |
src/Arius.Api.Tests/Features/Repositories/RepositoryRegionResolutionTests.cs |
Moves repository region-resolution tests. |
src/Arius.Api.Tests/Features/Downloads/DownloadNamingTests.cs |
Moves download naming tests. |
src/Arius.Api.Tests/Features/Downloads/DownloadCompletionTests.cs |
Moves download completion tests. |
src/Arius.Api.Tests/Features/Archive/ArchiveForwardersHashedRoutingTests.cs |
Moves archive event-routing tests. |
src/Arius.Api.Integration.Tests/Shared/Jobs/SingleActiveJobScenarioTests.cs |
Aligns active-job scenarios with Shared. |
src/Arius.Api.Integration.Tests/Shared/Jobs/ParkedCancelBroadcastTests.cs |
Aligns cancellation broadcast tests with Shared. |
src/Arius.Api.Integration.Tests/Shared/Jobs/ApprovalRegistryTests.cs |
Aligns approval-registry tests with Shared. |
src/Arius.Api.Integration.Tests/Harness/AriusApiFactory.cs |
Adds reusable in-process SignalR connections. |
src/Arius.Api.Integration.Tests/Features/Statistics/GetStatisticsTests.cs |
Tests statistics queries, caching, and missing containers. |
src/Arius.Api.Integration.Tests/Features/Snapshots/ListSnapshotsTests.cs |
Tests snapshot listing and missing containers. |
src/Arius.Api.Integration.Tests/Features/Schedules/ScheduleEndpointsTests.cs |
Tests schedule creation, listing, and deletion. |
src/Arius.Api.Integration.Tests/Features/Restore/StaleApprovalSweepTests.cs |
Moves stale-approval scenarios into Restore. |
src/Arius.Api.Integration.Tests/Features/Restore/RestoreCostHandshakeTests.cs |
Moves restore cost-handshake scenarios. |
src/Arius.Api.Integration.Tests/Features/Restore/RepresentationScenarioTests.cs |
Moves restore representation scenarios. |
src/Arius.Api.Integration.Tests/Features/Restore/ConcurrentResumeSmokeTests.cs |
Moves concurrent restore-resume coverage. |
src/Arius.Api.Integration.Tests/Features/Repositories/RepositoryDeleteGuardTests.cs |
Moves guarded repository-deletion coverage. |
src/Arius.Api.Integration.Tests/Features/Jobs/ReattachScenarioTests.cs |
Moves job reattachment scenarios. |
src/Arius.Api.Integration.Tests/Features/Jobs/LifecycleScenarioTests.cs |
Moves job lifecycle scenarios. |
src/Arius.Api.Integration.Tests/Features/Jobs/JobViewResolverTests.cs |
Moves job-view resolution coverage. |
src/Arius.Api.Integration.Tests/Features/Jobs/JobEndpointsTests.cs |
Tests history filtering and warning responses. |
src/Arius.Api.Integration.Tests/Features/Health/HealthSmokeTests.cs |
Moves health endpoint coverage. |
src/Arius.Api.Integration.Tests/Features/Filesystem/ListFilesystemTests.cs |
Tests directory listing and invalid paths. |
src/Arius.Api.Integration.Tests/Features/Downloads/DownloadJobTests.cs |
Updates download scenarios and request references. |
src/Arius.Api.Integration.Tests/Features/Downloads/DownloadEndpointsTests.cs |
Moves download endpoint coverage. |
src/Arius.Api.Integration.Tests/Features/Downloads/DownloadCleanupTests.cs |
Moves download cleanup coverage. |
src/Arius.Api.Integration.Tests/Features/Defaults/DefaultsEndpointsTests.cs |
Moves defaults endpoint coverage. |
src/Arius.Api.Integration.Tests/Features/Cost/CostSettingsEndpointsTests.cs |
Moves cost-setting endpoint coverage. |
src/Arius.Api.Integration.Tests/Features/Archive/ArchiveHubTests.cs |
Updates archive tests and documentation references. |
src/Arius.Api.Integration.Tests/Features/Accounts/StreamContainersHubTests.cs |
Tests container discovery through the hub. |
src/Arius.Api.Integration.Tests/Features/Accounts/AccountEndpointsTests.cs |
Tests account operations and secret handling. |
src/Arius.Api.FakeTestHost/TestingControlEndpoints.cs |
Updates relocated feature and infrastructure imports. |
src/Arius.Api.FakeTestHost/TestHost.cs |
Updates composition imports. |
src/Arius.Api.FakeTestHost/ScriptedRestoreHandler.cs |
Updates the shared job namespace import. |
src/Arius.Api.FakeTestHost/ScriptedReadHandler.cs |
Adds scripted read queries with request recording. |
src/Arius.Api.FakeTestHost/ScriptedContainerNamesHandler.cs |
Adds deterministic container discovery. |
src/Arius.Api.FakeTestHost/ScriptedArchiveHandler.cs |
Updates the shared job namespace import. |
src/Arius.Api.FakeTestHost/ScenarioRegistry.cs |
Adds configurable read scenarios and reset support. |
mkdocs.yml |
Adds ADR-0027 to documentation navigation. |
docs/glossary.md |
Updates download-related code locations. |
docs/design/cross-cutting/service-lifetimes.md |
Documents repository-less provider ownership. |
docs/design/cross-cutting/logging.md |
Updates logging composition paths. |
docs/design/cross-cutting/events-and-progress.md |
Documents feature-local event forwarder locations. |
docs/design/core/features/queries.md |
Documents latest-version and repository-less queries. |
docs/decisions/README.md |
Indexes the vertical-slice decision. |
AGENTS.md |
Records Api boundaries and repository-less composition guidance. |
Review effort: Balanced
Remove comments that restate the code, route-only summaries, section banners and change-history narration; rewrite the rest in plain technical English. Fix the statistics_cache schema comment, which described fingerprint re-checking that reads do not do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… docs Every REST operation now has a summary (and, where useful, a description of behaviour and non-200 status codes); non-obvious query parameters carry a [Description]. GenerateDocumentationFile is enabled so XML doc comments on request/response records become schema and property descriptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
REST handlers return their DTO or a typed Results<...> union (TypedResults) instead of a bare IResult, so every operation's responses and schemas appear in the OpenAPI document; GetDownloadContent, which writes the body itself, declares its responses with .Produces. The feature scan tags each endpoint with its area, so Scalar groups operations by area. Response schemas that became visible (job detail, progress snapshot, cost estimate, resume state, resolved defaults) are documented. ApiArchitectureTests now requires every REST endpoint to carry an OpenAPI summary and to declare a 2xx response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thoutRepository The generated mediator ran with its default Singleton lifetime, which resolves every discovered handler on first use. The repository-less provider therefore needed a throwing stand-in for each repository-bound handler (Core's AddAriusWithoutRepository). With a Transient lifetime a handler is resolved only when its message is sent, so the provider is just AddMediator() plus the blob service factory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oot placeholder graph The root container built a full AddArius graph over a NullBlobContainerService only so the eagerly-resolving mediator could start. With a Transient lifetime, AddMediator() plus the blob service factory serves ContainerNamesQuery on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… test mocks CliHarness mocked handlers the CLI never sends, and the event-routing and storage-info tests registered services, only because the Singleton mediator resolved every handler on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ADR-0028 and updates the host, lifetime and testing design docs and AGENTS.md files that described the stand-in handlers and placeholder graphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Query(Last) SnapshotsListQuery gains an optional Last parameter that keeps only the newest N snapshot blobs before resolving manifests. The stats endpoint fingerprints its cache with SnapshotsListQuery(Last: 1), so the single-use LatestSnapshotVersionQuery feature, its registrations and its test stand-ins go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests run in parallel and shared one ~/.arius cache folder, so concurrent writes of the same filetree collided on Windows (IOException: file in use). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfe8548 removed the route-only summaries (<c>GET /accounts</c>) and the "Hub <c>X</c>" prefixes. Put them back on every endpoint class and hub handler, with each route taken from the endpoint's current Map* call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Describe the Api's provider without a repository by its role instead of by GetRepositoryLessProvider, in web.md, service-lifetimes.md and the ADRs. - service-lifetimes: record the Transient mediator lifetime (ADR-0028) and its effect on handler scope. - web.md: restructure the Api layout into a table and bullets; fix stale names (JobSink counters, DownloadStaging path, defaults endpoints) and the global-search open seam. - testing.md: add ScriptedReadHandler and ScriptedContainerNamesHandler. - glossary: downloads are served by GetDownloadContent. - ADR-0028: note that ADR-0022's eager-resolution drawback no longer applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Api ModulithTests and ApiArchitectureTests each carried their own copy of the namespace-scoped-internal check, and the copies had drifted (dedup/sort, consumer filtering). Both now delegate to NamespaceScopedInternals, keyed by the assembly's own [SharedWithinAssembly] attribute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each Commands/<Verb> folder now keeps its internal types to itself, with CliBuilder as the composition root that wires every verb. Arius.Cli gets its own internal [SharedWithinAssembly] opt-out, matching Core and Api. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No other non-test assembly consumes them: the Mediator source generator runs in Arius.Cli itself, and Arius.Cli.Tests reaches them through InternalsVisibleTo. ProgressState and its Tracked*/state types were public only because the public handler constructors exposed them. The handlers are now also covered by the namespace-scoped-internal architecture rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No other non-test assembly consumes them: the Mediator source generator that registers the forwarders runs in Arius.Api itself, and the tests reach both through InternalsVisibleTo. JobSink stays public for now: internalizing it cascades through RepositoryProviderRegistry, JobStateRegistry, JobRunner and the public endpoint classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refactor(api): re-architect Arius.Api into vertical slices (Features + Shared) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Arius.Apimoves from technical layers (Endpoints/,Hubs/,Jobs/,Contracts/, …) to the same vertical-slice shape asArius.Core:Features/<Area>/+Shared/. Routes, hub method names, message names and JSON shapes are unchanged.Features/Accounts/CreateAccount.cs), in the request-endpoint-response style. It implementsIEndpoint, takes its services through its constructor, maps its own route and handles it in a privateHandle/HandleAsync. Its DTOs are inCreateAccountDtos.cs; a DTO shared within an area gets its own file (AccountDto.cs). Endpoints are found by an assembly scan, so there are no registration lists.Results<…>union so its responses and schemas appear in the document, and is tagged with its area so Scalar groups operations by area.JobsHubis a thin dispatcher with no constructor dependencies. Each hub method's behaviour is anIHubHandlerclass in a feature file (Features/Archive/StartArchive.cs), which the hub method receives as a[FromServices]parameter. SignalR requires the public methods to stay on the hub class.Transientlifetime), so a provider registers only the services its requests use.AppDatabaseis split into one partial file per table.Features/Cost(notCostSettings), because a namespace of that name would shadow theCostSettingsrecord.internal: an internal type may be used only from its own namespace or one below it, unless it is marked[SharedWithinAssembly]. Core and the Api now run one shared check for this, and the CLI gets the same rule, withCliBuilderas its composition root.ProgressStateandCliBuilderare nowinternal. Only test projects used them from outside their assembly.Decisions recorded in ADR-0027 (vertical slices) and ADR-0028 (Mediator lifetime).
How to review
The commits are ordered so each step can be verified on its own; reviewing commit by commit is easiest.
ef362259Features/+Shared/, old namespaces keptsrc/Arius.Apichanges; Api tests pass untouched5145f105usinglines, one qualified name, a doc cref and a path comment change19ddd579src/Arius.Apichanges; same tests pass7660ca96StreamContainersgoes through Core'sContainerNamesQueryinstead ofIBlobServiceFactory455e334dISnapshotService(the query is replaced in867efc34)074940d6,1053f4a26a4b1b3aAGENTS.mdfiles, design docs, glossarycfe694e832d01002,0d6d5a14StreamEntries(see below)cf283eef,24fef17eFeaturesc0951f81Arius.Apiline coverage 74% → 91.5%dd3d971b…9b31a2b7Handlemethods become private; the naming convention lives in the ApiAGENTS.mdc526767bSearchAllstreams hits as they are foundBrowseHubTestsdfe854868cb7ca61,bfdfe29fea36ccf7…e700b7d1Transientlifetime; stand-in handlers and placeholder graphs removed (#249)Singleton867efc34LatestSnapshotVersionQueryis replaced by an optionalLastonSnapshotsListQuery; the statistics endpoint usesLast: 1SnapshotsListQueryHandlerTests,GetStatisticsTestsff3681f3FileTreeWalkerTeststest gets its own cache folder (parallel runs collided on Windows)0d534717,540e83fe,13731d5e,e12178d54980e92b,9867711einternalcheck for Core and Api, extended to the CLI1d0db1d6,0490f172ProgressState, Api event forwarders andCliBuilderbecomeinternalBehaviour changes
The first three commits are behaviour-preserving. The rest change the following:
Sharedservices from the Api (the host-boundary rule inAGENTS.md):StreamContainerssendsContainerNamesQuerythrough a repository-less provider (AddMediator()plus the blob service factory).SnapshotsListQuerywith the new optionalLast: 1.Transientlifetime in the Api, the CLI and Explorer. Handlers are resolved per message. Repository services andAddArius's handler factories remain per-provider singletons.SearchAllstreams hits as they are found. A repository that can't be opened is skipped, and a cancelled search stops.Verification
Arius.Core.Tests681 (1 skipped),Arius.Api.Tests160,Arius.Api.Integration.Tests105,Arius.Cli.Tests173,Arius.Architecture.Tests22: all pass.mkdocs build --strictpasses.c0951f81:Arius.Apiline coverage (both Api test projects merged, dotnet-coverage): 91.5% (2585/2825), up from 74.0%.Arius.Integration.Tests: 82 pass, 4 skipped.npm run e2e:hermetic, real SPA againstArius.Api.FakeTestHost): 14/14./openapi/v1.jsonwas byte-identical to the pre-change baseline atcfe694e8.8cb7ca61andbfdfe29fextend it on purpose.Arius.E2E.Tests,Arius.AzureBlob.Tests,Arius.Explorer.Tests(Windows-only).Notes for the reviewer
32d01002theStreamEntrieshub method could not be called. The compiler had put a nullability attribute on the handler parameter, so SignalR treated it as a wire argument. The hermetic e2e suite did not catch it because it does not browse a repository; the new hub tests did.0d6d5a14marks every handler parameter[FromServices]and adds an architecture rule for it.publicbecause they appear in the public hub's method signatures (JobsHubmust stay public forArius.Api.FakeTestHost).ScriptedReadHandler: list, snapshots, statistics). It is additive; existing scenarios are unchanged.async IAsyncEnumerablebodies, so the three hub streaming features are checked on signatures only. This is stated in the test, the ADR andAGENTS.md.Transientlifetime. All current handlers keep their state in injected singletons (ProgressState,JobSink).DELETE /repos/{id}/schedules/{scheduleId}ignores the repository id.CreateAccountandCreateRepositoryreturn aLocationheader without the/apiprefix.AppDatabasesetsPRAGMA foreign_keys = ononly on the schema-setup connection.NotConfigured*Handlerstand-ins are no longer required. They are kept because they give unscripted requests a clearNotSupportedException.JobSinkis no longer required.JobSinkis stillpublic. Making itinternalrequiresRepositoryProviderRegistry,JobStateRegistry,JobRunnerand the public endpoint classes that take them to become internal too. Most of the Api's top-level types are public, so this is an Api-wide visibility change.JobRunnerandJobSinkmoved toShared/Jobsunchanged.🤖 Generated with Claude Code