Skip to content

refactor(api): re-architect Arius.Api into vertical slices (Features + Shared) - #248

Merged
woutervanranst merged 35 commits into
masterfrom
modern-math-2ee45248
Nov 21, 2026
Merged

woutervanranst merged 35 commits into
masterfrom
modern-math-2ee45248

Conversation

@woutervanranst

@woutervanranst woutervanranst commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What

Arius.Api moves from technical layers (Endpoints/, Hubs/, Jobs/, Contracts/, …) to the same vertical-slice shape as Arius.Core: Features/<Area>/ + Shared/. Routes, hub method names, message names and JSON shapes are unchanged.

  • REST: one endpoint class per file, named after it (Features/Accounts/CreateAccount.cs), in the request-endpoint-response style. It implements IEndpoint, takes its services through its constructor, maps its own route and handles it in a private Handle/HandleAsync. Its DTOs are in CreateAccountDtos.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.
  • OpenAPI: every operation has a summary, returns its DTO or a typed Results<…> union so its responses and schemas appear in the document, and is tagged with its area so Scalar groups operations by area.
  • Hub: JobsHub is a thin dispatcher with no constructor dependencies. Each hub method's behaviour is an IHubHandler class 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.
  • Mediator: every host resolves a handler only when its message is sent (Transient lifetime), so a provider registers only the services its requests use.
  • Shared: AppDatabase is split into one partial file per table.
  • The cost area is Features/Cost (not CostSettings), because a namespace of that name would shadow the CostSettings record.
  • Namespace-scoped 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, with CliBuilder as its composition root.
  • Visibility: the Api's event forwarders and the CLI's progress handlers, ProgressState and CliBuilder are now internal. 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.

Commit What Check
ef362259 Api moved and split into Features/ + Shared/, old namespaces kept Nothing outside src/Arius.Api changes; Api tests pass untouched
5145f105 Namespaces mirror folders Outside the Api only using lines, one qualified name, a doc cref and a path comment change
19ddd579 Both Api test projects mirror the layout Nothing under src/Arius.Api changes; same tests pass
7660ca96 StreamContainers goes through Core's ContainerNamesQuery instead of IBlobServiceFactory New hub test + production-composition test
455e334d Statistics endpoint stamps its cache through a Core query instead of ISnapshotService (the query is replaced in 867efc34) New Core tests
074940d6, 1053f4a2 Architecture rules for the Api, plus review follow-ups Rules mutation-checked against planted violations
6a4b1b3a Docs: ADR-0027, AGENTS.md files, design docs, glossary
cfe694e8 REST endpoints become injected endpoint classes, found by assembly scan OpenAPI identical; no existing test edited
32d01002, 0d6d5a14 Hub methods forward to injected handler classes; fix for StreamEntries (see below) New hub tests; architecture rule
cf283eef, 24fef17e Docs and an architecture rule pinning endpoints/handlers to Features
c0951f81 Tests: stores, REST endpoints, hub features Arius.Api line coverage 74% → 91.5%
dd3d971b…9b31a2b7 Endpoint Handle methods become private; the naming convention lives in the Api AGENTS.md
c526767b SearchAll streams hits as they are found New test in BrowseHubTests
dfe85486 Comments and doc text state intent Comments and docs only
8cb7ca61, bfdfe29f OpenAPI summaries, typed responses, area tags Architecture rule: every endpoint has a summary and a 2xx response
ea36ccf7…e700b7d1 Mediator Transient lifetime; stand-in handlers and placeholder graphs removed (#249) Repository-less provider test fails under Singleton
867efc34 LatestSnapshotVersionQuery is replaced by an optional Last on SnapshotsListQuery; the statistics endpoint uses Last: 1 SnapshotsListQueryHandlerTests, GetStatisticsTests
ff3681f3 Each FileTreeWalkerTests test gets its own cache folder (parallel runs collided on Windows) Test-only
0d534717, 540e83fe, 13731d5e, e12178d5 Route summaries restored on endpoint and hub handler classes; design docs synced with the Api and Mediator changes Comments and docs only
4980e92b, 9867711e One shared namespace-scoped-internal check for Core and Api, extended to the CLI Rule fails on planted violations in Core, Api and CLI
1d0db1d6, 0490f172 CLI progress handlers, ProgressState, Api event forwarders and CliBuilder become internal Generated Mediator code unchanged; Mediator routing tests pass

Behaviour changes

The first three commits are behaviour-preserving. The rest change the following:

  • No direct use of Core Shared services from the Api (the host-boundary rule in AGENTS.md):
    • StreamContainers sends ContainerNamesQuery through a repository-less provider (AddMediator() plus the blob service factory).
    • The statistics endpoint uses SnapshotsListQuery with the new optional Last: 1.
  • Mediator Transient lifetime in the Api, the CLI and Explorer. Handlers are resolved per message. Repository services and AddArius's handler factories remain per-provider singletons.
  • SearchAll streams hits as they are found. A repository that can't be opened is skipped, and a cancelled search stops.
  • OpenAPI documents summaries, response schemas and area tags.

Verification

  • At the branch head:
    • Arius.Core.Tests 681 (1 skipped), Arius.Api.Tests 160, Arius.Api.Integration.Tests 105, Arius.Cli.Tests 173, Arius.Architecture.Tests 22: all pass.
    • The full solution builds on macOS, including Explorer.
    • mkdocs build --strict passes.
  • At c0951f81:
    • Arius.Api line coverage (both Api test projects merged, dotnet-coverage): 91.5% (2585/2825), up from 74.0%.
    • Arius.Integration.Tests: 82 pass, 4 skipped.
    • Hermetic Playwright e2e (npm run e2e:hermetic, real SPA against Arius.Api.FakeTestHost): 14/14.
    • /openapi/v1.json was byte-identical to the pre-change baseline at cfe694e8. 8cb7ca61 and bfdfe29f extend it on purpose.
  • Not run: Arius.E2E.Tests, Arius.AzureBlob.Tests, Arius.Explorer.Tests (Windows-only).

Notes for the reviewer

  • Bug introduced and fixed in this PR: in 32d01002 the StreamEntries hub 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. 0d6d5a14 marks every handler parameter [FromServices] and adds an architecture rule for it.
  • Hub handler classes are public because they appear in the public hub's method signatures (JobsHub must stay public for Arius.Api.FakeTestHost).
  • Scripted Core gained a read scenario (ScriptedReadHandler: list, snapshots, statistics). It is additive; existing scenarios are unchanged.
  • Architecture-test blind spot: ArchUnitNET does not see inside async IAsyncEnumerable bodies, so the three hub streaming features are checked on signatures only. This is stated in the test, the ADR and AGENTS.md.
  • Handlers must be stateless under the Transient lifetime. All current handlers keep their state in injected singletons (ProgressState, JobSink).
  • Found while writing tests, not changed here:
    • DELETE /repos/{id}/schedules/{scheduleId} ignores the repository id.
    • CreateAccount and CreateRepository return a Location header without the /api prefix.
    • AppDatabase sets PRAGMA foreign_keys = on only on the schema-setup connection.
  • Possible follow-ups:
    • The fake host's NotConfigured*Handler stand-ins are no longer required. They are kept because they give unscripted requests a clear NotSupportedException.
    • The Api read providers' inert JobSink is no longer required.
    • JobSink is still public. Making it internal requires RepositoryProviderRegistry, JobStateRegistry, JobRunner and 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.
  • Out of scope: JobRunner and JobSink moved to Shared/Jobs unchanged.

🤖 Generated with Claude Code

woutervanranst and others added 8 commits November 18, 2026 07:58
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>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too 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.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a11ff96 and 0490f17.

Files selected for processing: 255

  • AGENTS.md
  • docs/decisions/README.md
  • docs/decisions/adr-0027-api-vertical-slices.md
  • docs/decisions/adr-0028-resolve-mediator-handlers-per-message.md
  • docs/design/core/features/queries.md
  • docs/design/cross-cutting/events-and-progress.md
  • docs/design/cross-cutting/logging.md
  • docs/design/cross-cutting/service-lifetimes.md
  • docs/design/cross-cutting/testing.md
  • docs/design/hosts/cli.md
  • docs/design/hosts/explorer.md
  • docs/design/hosts/web.md
  • docs/glossary.md
  • mkdocs.yml
  • src/Arius.Api.FakeTestHost/NotConfiguredHandlers.cs
  • src/Arius.Api.FakeTestHost/ScenarioRegistry.cs
  • src/Arius.Api.FakeTestHost/ScriptedArchiveHandler.cs
  • src/Arius.Api.FakeTestHost/ScriptedContainerNamesHandler.cs
  • src/Arius.Api.FakeTestHost/ScriptedReadHandler.cs
  • src/Arius.Api.FakeTestHost/ScriptedRepositoryCoreComposer.cs
  • src/Arius.Api.FakeTestHost/ScriptedRestoreHandler.cs
  • src/Arius.Api.FakeTestHost/TestHost.cs
  • src/Arius.Api.FakeTestHost/TestingControlEndpoints.cs
  • src/Arius.Api.Integration.Tests/Features/Accounts/AccountEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Accounts/StreamContainersHubTests.cs
  • src/Arius.Api.Integration.Tests/Features/Archive/ArchiveHubTests.cs
  • src/Arius.Api.Integration.Tests/Features/Browse/BrowseHubTests.cs
  • src/Arius.Api.Integration.Tests/Features/Cost/CostSettingsEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Defaults/DefaultsEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Downloads/DownloadCleanupTests.cs
  • src/Arius.Api.Integration.Tests/Features/Downloads/DownloadEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Downloads/DownloadJobTests.cs
  • src/Arius.Api.Integration.Tests/Features/Filesystem/ListFilesystemTests.cs
  • src/Arius.Api.Integration.Tests/Features/Health/HealthSmokeTests.cs
  • src/Arius.Api.Integration.Tests/Features/Jobs/JobEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Jobs/JobHubTests.cs
  • src/Arius.Api.Integration.Tests/Features/Jobs/JobViewResolverTests.cs
  • src/Arius.Api.Integration.Tests/Features/Jobs/LifecycleScenarioTests.cs
  • src/Arius.Api.Integration.Tests/Features/Jobs/ReattachScenarioTests.cs
  • src/Arius.Api.Integration.Tests/Features/Repositories/RepositoryDeleteGuardTests.cs
  • src/Arius.Api.Integration.Tests/Features/Repositories/RepositoryEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Restore/ConcurrentResumeSmokeTests.cs
  • src/Arius.Api.Integration.Tests/Features/Restore/RepresentationScenarioTests.cs
  • src/Arius.Api.Integration.Tests/Features/Restore/RestoreCostHandshakeTests.cs
  • src/Arius.Api.Integration.Tests/Features/Restore/RestoreHubTests.cs
  • src/Arius.Api.Integration.Tests/Features/Restore/StaleApprovalSweepTests.cs
  • src/Arius.Api.Integration.Tests/Features/Schedules/ScheduleEndpointsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Snapshots/ListSnapshotsTests.cs
  • src/Arius.Api.Integration.Tests/Features/Statistics/GetStatisticsTests.cs
  • src/Arius.Api.Integration.Tests/Harness/AriusApiFactory.cs
  • src/Arius.Api.Integration.Tests/Shared/Jobs/ApprovalRegistryTests.cs
  • src/Arius.Api.Integration.Tests/Shared/Jobs/ParkedCancelBroadcastTests.cs
  • src/Arius.Api.Integration.Tests/Shared/Jobs/SingleActiveJobScenarioTests.cs
  • src/Arius.Api.Tests/Features/Archive/ArchiveForwardersHashedRoutingTests.cs
  • src/Arius.Api.Tests/Features/Downloads/DownloadCompletionTests.cs
  • src/Arius.Api.Tests/Features/Downloads/DownloadNamingTests.cs
  • src/Arius.Api.Tests/Features/Repositories/RepositoryRegionResolutionTests.cs
  • src/Arius.Api.Tests/Features/Restore/RehydrationScheduleTests.cs
  • src/Arius.Api.Tests/Features/Restore/RepresentationTests.cs
  • src/Arius.Api.Tests/Features/Schedules/SchedulerServiceTests.cs
  • src/Arius.Api.Tests/Shared/AppData/AccountStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/CostSettingsStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/DefaultTierMigrationTests.cs
  • src/Arius.Api.Tests/Shared/AppData/DefaultsStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/DownloadStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/JobGuardTests.cs
  • src/Arius.Api.Tests/Shared/AppData/JobLifecycleDbTests.cs
  • src/Arius.Api.Tests/Shared/AppData/JobStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/LastArchiveRunTests.cs
  • src/Arius.Api.Tests/Shared/AppData/OptionDefaultsTests.cs
  • src/Arius.Api.Tests/Shared/AppData/RepositoryStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/ScheduleStoreTests.cs
  • src/Arius.Api.Tests/Shared/AppData/StatisticsCacheTests.cs
  • src/Arius.Api.Tests/Shared/AppData/TempAppDatabase.cs
  • src/Arius.Api.Tests/Shared/Composition/AriusLoggingTests.cs
  • src/Arius.Api.Tests/Shared/Composition/RepositoryLessProviderTests.cs
  • src/Arius.Api.Tests/Shared/Composition/RepositoryProviderRegistryRemovalTests.cs
  • src/Arius.Api.Tests/Shared/Downloads/DownloadStagingTests.cs
  • src/Arius.Api.Tests/Shared/Hosting/FeatureRegistrationTests.cs
  • src/Arius.Api.Tests/Shared/Jobs/JobSinkAggregateTests.cs
  • src/Arius.Api.Tests/Shared/Jobs/JobSinkEtaTests.cs
  • src/Arius.Api.Tests/Shared/Jobs/JobSinkProgressFixesTests.cs
  • src/Arius.Api.Tests/Shared/Jobs/JobSinkWarningsTests.cs
  • src/Arius.Api.Tests/Shared/Jobs/JobStateRegistryTests.cs
  • src/Arius.Api/AGENTS.md
  • src/Arius.Api/AppData/AppDatabase.cs
  • src/Arius.Api/AppData/JobStatuses.cs
  • src/Arius.Api/Arius.Api.csproj
  • src/Arius.Api/AriusApiHost.cs
  • src/Arius.Api/AssemblyMarker.cs
  • src/Arius.Api/Composition/IRepositoryCoreComposer.cs
  • src/Arius.Api/Contracts/DownloadDtos.cs
  • src/Arius.Api/Contracts/Dtos.cs
  • src/Arius.Api/Contracts/JobDetailDtos.cs
  • src/Arius.Api/Endpoints/AccountEndpoints.cs
  • src/Arius.Api/Endpoints/BrowseEndpoints.cs
  • src/Arius.Api/Endpoints/CostSettingsEndpoints.cs
  • src/Arius.Api/Endpoints/DefaultsEndpoints.cs
  • src/Arius.Api/Endpoints/DownloadEndpoints.cs
  • src/Arius.Api/Endpoints/FilesystemEndpoints.cs
  • src/Arius.Api/Endpoints/JobEndpoints.cs
  • src/Arius.Api/Endpoints/RepositoryEndpoints.cs
  • src/Arius.Api/Features/Accounts/AccountDto.cs
  • src/Arius.Api/Features/Accounts/AccountEndpoints.cs
  • src/Arius.Api/Features/Accounts/CreateAccount.cs
  • src/Arius.Api/Features/Accounts/CreateAccountDtos.cs
  • src/Arius.Api/Features/Accounts/DeleteAccount.cs
  • src/Arius.Api/Features/Accounts/GetAccount.cs
  • src/Arius.Api/Features/Accounts/ListAccounts.cs
  • src/Arius.Api/Features/Accounts/StreamContainers.cs
  • src/Arius.Api/Features/Accounts/UpdateAccount.cs
  • src/Arius.Api/Features/Accounts/UpdateAccountDtos.cs
  • src/Arius.Api/Features/Archive/ArchiveForwarders.cs
  • src/Arius.Api/Features/Archive/StartArchive.cs
  • src/Arius.Api/Features/Browse/EntryDto.cs
  • src/Arius.Api/Features/Browse/EntryMapping.cs
  • src/Arius.Api/Features/Browse/SearchAll.cs
  • src/Arius.Api/Features/Browse/SearchAllDtos.cs
  • src/Arius.Api/Features/Browse/StreamEntries.cs
  • src/Arius.Api/Features/Cost/GetCostSettings.cs
  • src/Arius.Api/Features/Cost/UpdateCostSettings.cs
  • src/Arius.Api/Features/Defaults/DefaultsEndpoints.cs
  • src/Arius.Api/Features/Defaults/GetGlobalDefaults.cs
  • src/Arius.Api/Features/Defaults/GetRepositoryDefaults.cs
  • src/Arius.Api/Features/Defaults/GlobalDefaultsDto.cs
  • src/Arius.Api/Features/Defaults/RepositoryDefaultsDto.cs
  • src/Arius.Api/Features/Defaults/UpdateGlobalDefaults.cs
  • src/Arius.Api/Features/Defaults/UpdateRepositoryDefaults.cs
  • src/Arius.Api/Features/Downloads/CleanupDownload.cs
  • src/Arius.Api/Features/Downloads/CleanupDownloads.cs
  • src/Arius.Api/Features/Downloads/DownloadCleaner.cs
  • src/Arius.Api/Features/Downloads/DownloadCleanupService.cs
  • src/Arius.Api/Features/Downloads/DownloadEndpoints.cs
  • src/Arius.Api/Features/Downloads/DownloadNaming.cs
  • src/Arius.Api/Features/Downloads/DownloadUsageDto.cs
  • src/Arius.Api/Features/Downloads/GetDownload.cs
  • src/Arius.Api/Features/Downloads/GetDownloadContent.cs
  • src/Arius.Api/Features/Downloads/GetDownloadDtos.cs
  • src/Arius.Api/Features/Downloads/GetDownloadSettings.cs
  • src/Arius.Api/Features/Downloads/GetDownloadsUsage.cs
  • src/Arius.Api/Features/Downloads/GetPendingDownload.cs
  • src/Arius.Api/Features/Downloads/GetPendingDownloadDtos.cs
  • src/Arius.Api/Features/Downloads/StartDownload.cs
  • src/Arius.Api/Features/Downloads/StartDownloadDtos.cs
  • src/Arius.Api/Features/Downloads/UpdateDownloadSettings.cs
  • src/Arius.Api/Features/Filesystem/ListFilesystem.cs
  • src/Arius.Api/Features/Filesystem/ListFilesystemDtos.cs
  • src/Arius.Api/Features/Health/GetHealth.cs
  • src/Arius.Api/Features/Health/GetHealthDtos.cs
  • src/Arius.Api/Features/Jobs/AttachToJob.cs
  • src/Arius.Api/Features/Jobs/AttachToJobDtos.cs
  • src/Arius.Api/Features/Jobs/CancelJob.cs
  • src/Arius.Api/Features/Jobs/DetachFromJob.cs
  • src/Arius.Api/Features/Jobs/GetJob.cs
  • src/Arius.Api/Features/Jobs/GetJobDtos.cs
  • src/Arius.Api/Features/Jobs/GetJobWarnings.cs
  • src/Arius.Api/Features/Jobs/GetJobWarningsDtos.cs
  • src/Arius.Api/Features/Jobs/JobViewResolver.cs
  • src/Arius.Api/Features/Jobs/ListJobs.cs
  • src/Arius.Api/Features/Jobs/ListJobsDtos.cs
  • src/Arius.Api/Features/Jobs/ResumeInfo.cs
  • src/Arius.Api/Features/Repositories/CreateRepository.cs
  • src/Arius.Api/Features/Repositories/CreateRepositoryDtos.cs
  • src/Arius.Api/Features/Repositories/DeleteRepository.cs
  • src/Arius.Api/Features/Repositories/GetRepository.cs
  • src/Arius.Api/Features/Repositories/ListRepositories.cs
  • src/Arius.Api/Features/Repositories/RepositoryDto.cs
  • src/Arius.Api/Features/Repositories/RepositoryEndpoints.cs
  • src/Arius.Api/Features/Repositories/UpdateRepository.cs
  • src/Arius.Api/Features/Repositories/UpdateRepositoryDtos.cs
  • src/Arius.Api/Features/Restore/ApproveRestore.cs
  • src/Arius.Api/Features/Restore/DeclineRestore.cs
  • src/Arius.Api/Features/Restore/RehydrationPollingService.cs
  • src/Arius.Api/Features/Restore/RehydrationSchedule.cs
  • src/Arius.Api/Features/Restore/RestoreForwarders.cs
  • src/Arius.Api/Features/Restore/ResumeRestore.cs
  • src/Arius.Api/Features/Restore/SetAutoResume.cs
  • src/Arius.Api/Features/Restore/StaleApprovalSweepService.cs
  • src/Arius.Api/Features/Restore/StartRestore.cs
  • src/Arius.Api/Features/Schedules/CreateSchedule.cs
  • src/Arius.Api/Features/Schedules/CreateScheduleDtos.cs
  • src/Arius.Api/Features/Schedules/DeleteSchedule.cs
  • src/Arius.Api/Features/Schedules/ListSchedules.cs
  • src/Arius.Api/Features/Schedules/ScheduleDto.cs
  • src/Arius.Api/Features/Schedules/ScheduleEndpoints.cs
  • src/Arius.Api/Features/Schedules/SchedulerService.cs
  • src/Arius.Api/Features/Snapshots/ListSnapshots.cs
  • src/Arius.Api/Features/Snapshots/ListSnapshotsDtos.cs
  • src/Arius.Api/Features/Statistics/GetStatistics.cs
  • src/Arius.Api/Features/Statistics/GetStatisticsDtos.cs
  • src/Arius.Api/Hubs/JobsHub.cs
  • src/Arius.Api/Jobs/JobSnapshot.cs
  • src/Arius.Api/Jobs/PersistedJobState.cs
  • src/Arius.Api/Jobs/RestoreApprovalRegistry.cs
  • src/Arius.Api/Program.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Accounts.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Cost.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Defaults.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Downloads.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Jobs.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Repositories.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.Schedules.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.StatisticsCache.cs
  • src/Arius.Api/Shared/AppData/AppDatabase.cs
  • src/Arius.Api/Shared/AppData/JobStatuses.cs
  • src/Arius.Api/Shared/AppData/OptionDefaults.cs
  • src/Arius.Api/Shared/AppData/Records.cs
  • src/Arius.Api/Shared/AppData/SecretProtector.cs
  • src/Arius.Api/Shared/Composition/AriusLogging.cs
  • src/Arius.Api/Shared/Composition/AzureRepositoryCoreComposer.cs
  • src/Arius.Api/Shared/Composition/IRepositoryCoreComposer.cs
  • src/Arius.Api/Shared/Composition/RepositoryProviderRegistry.cs
  • src/Arius.Api/Shared/Downloads/DownloadStaging.cs
  • src/Arius.Api/Shared/Hosting/FeatureRegistration.cs
  • src/Arius.Api/Shared/Hosting/IEndpoint.cs
  • src/Arius.Api/Shared/Hosting/IHubHandler.cs
  • src/Arius.Api/Shared/Hosting/PeriodicTimerExtensions.cs
  • src/Arius.Api/Shared/Hubs/JobsHub.cs
  • src/Arius.Api/Shared/Jobs/CostEstimateDto.cs
  • src/Arius.Api/Shared/Jobs/JobFormat.cs
  • src/Arius.Api/Shared/Jobs/JobRunner.cs
  • src/Arius.Api/Shared/Jobs/JobSink.cs
  • src/Arius.Api/Shared/Jobs/JobSnapshot.cs
  • src/Arius.Api/Shared/Jobs/JobStateRegistry.cs
  • src/Arius.Api/Shared/Jobs/PersistedJobState.cs
  • src/Arius.Api/Shared/Jobs/RestoreApprovalRegistry.cs
  • src/Arius.Api/SharedWithinAssemblyAttribute.cs
  • src/Arius.Architecture.Tests/ApiArchitectureTests.cs
  • src/Arius.Architecture.Tests/Arius.Architecture.Tests.csproj
  • src/Arius.Architecture.Tests/CliArchitectureTests.cs
  • src/Arius.Architecture.Tests/DependencyTests.cs
  • src/Arius.Architecture.Tests/ModulithTests.cs
  • src/Arius.Architecture.Tests/NamespaceScopedInternals.cs
  • src/Arius.Cli.Tests/MediatorEventRoutingIntegrationTests.cs
  • src/Arius.Cli.Tests/StorageAccountInfoQueryDispatchTests.cs
  • src/Arius.Cli.Tests/TestSupport/CliHarness.cs
  • src/Arius.Cli/AGENTS.md
  • src/Arius.Cli/Arius.Cli.csproj
  • src/Arius.Cli/AssemblyMarker.cs
  • src/Arius.Cli/CliBuilder.cs
  • src/Arius.Cli/Commands/Archive/ArchiveProgressHandlers.cs
  • src/Arius.Cli/Commands/Restore/RestoreProgressHandlers.cs
  • src/Arius.Cli/ProgressState.cs
  • src/Arius.Cli/SharedWithinAssemblyAttribute.cs
  • src/Arius.Core.Tests/Features/RestoreCommand/FileTreeWalkerTests.cs
  • src/Arius.Core.Tests/Features/SnapshotsListQuery/SnapshotsListQueryHandlerTests.cs
  • src/Arius.Core.Tests/ServiceCollectionExtensionsTests.cs
  • src/Arius.Core/AGENTS.md
  • src/Arius.Core/Features/SnapshotsListQuery/SnapshotsListQuery.cs
  • src/Arius.Core/ServiceCollectionExtensions.cs
  • src/Arius.Explorer.Tests/Infrastructure/RepositorySessionTests.cs
  • src/Arius.Explorer/AGENTS.md
  • src/Arius.Explorer/AssemblyInfo.cs
  • src/Arius.Explorer/Infrastructure/RepositorySession.cs
  • src/Arius.Explorer/Program.cs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.02426% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.63%. Comparing base (a11ff96) to head (0490f17).
⚠️ Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
src/Arius.Api/Features/Downloads/StartDownload.cs 40.00% 10 Missing and 2 partials ⚠️
...rc/Arius.Api/Features/Accounts/StreamContainers.cs 41.66% 4 Missing and 3 partials ⚠️
...Arius.Api/Features/Downloads/GetDownloadContent.cs 90.38% 1 Missing and 4 partials ⚠️
...rc/Arius.Api/Features/Filesystem/ListFilesystem.cs 82.60% 2 Missing and 2 partials ⚠️
...rc/Arius.Api/Features/Archive/ArchiveForwarders.cs 76.92% 3 Missing ⚠️
src/Arius.Api/Features/Archive/StartArchive.cs 75.00% 1 Missing and 1 partial ⚠️
src/Arius.Api/Features/Browse/StreamEntries.cs 88.88% 0 Missing and 2 partials ⚠️
src/Arius.Api/Features/Downloads/GetDownload.cs 84.61% 0 Missing and 2 partials ⚠️
src/Arius.Api/Features/Jobs/GetJob.cs 83.33% 0 Missing and 2 partials ⚠️
...rc/Arius.Api/Features/Restore/RestoreForwarders.cs 71.42% 2 Missing ⚠️
... and 17 more
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     
Flag Coverage Δ
linux 85.02% <96.02%> (+3.49%) ⬆️
web 51.11% <ø> (ø)
windows 82.51% <96.02%> (+3.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

woutervanranst and others added 10 commits November 18, 2026 22:27
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 JobsHub dispatcher.
  • 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

woutervanranst and others added 3 commits November 19, 2026 07:20
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>
woutervanranst and others added 14 commits November 21, 2026 09:37
…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>
@woutervanranst
woutervanranst merged commit e62184b into master Nov 21, 2026
19 of 20 checks passed
@woutervanranst
woutervanranst deleted the modern-math-2ee45248 branch November 21, 2026 13:45
woutervanranst added a commit that referenced this pull request Nov 21, 2026
refactor(api): re-architect Arius.Api into vertical slices (Features + Shared)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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