Repository navigation
refactor(arch): move Farm into Modules/Farm - #1096
Merged
Merged
Conversation
…Repository.cs move.py split: FarmLogoMetadata, FarmLogoContent and FarmBrandingHashes leave the repository port's file, each into its own file in the same namespace. Each declaration is a verbatim slice of the original. Refs #1087
move.py move with the slice's table: Domain, Application and Api files go under Modules/Farm, contract types under Contracts, with the namespace taken from the folder. UserRoleAssignment stays in Farm (Domain/Modules/Farm/ Accounts) with its table-owner override and seam entry; the Seam strings, edge symbols and registry rows follow the move. The current model snapshot follows the moved entities; historical migrations and Designer files are untouched. The rules file now names Cluckwork.Domain.Modules.Farm and Cluckwork.Application.Modules.Farm; Implementations stay for S9. Refs #1087
IFarmModule's comment still said adapters reach Farm through the types marked [ModuleContract]; those marks go in this slice. It was the last such comment. Refs #1087
…for Farm's namespace RequireActiveOwnerAsync, CountOtherActiveOwnersAsync and DisableUserAsync spell Cluckwork.Domain.Accounts.Roles.Owner in full inside their queries, so their #632 token hashes follow the namespace: RequireActiveOwnerAsync aed7b297 -> 71384910 (db.Roles, db.UserRoles) CountOtherActiveOwnersAsync 57009ecd -> b7bada95 (db.Roles, db.UserRoles) DisableUserAsync 9b6fec98 -> 9e5764d7 (db.Roles, db.UserRoles) Proof, run with the real GuardScanner.QuerySignatureOf on the base and head files: each method's whole token stream is equal after normalizing only Cluckwork.Domain.Accounts. to Cluckwork.Domain.Modules.Farm.Accounts. (each gains exactly four tokens). No predicate changed. The names stay fully qualified and the hasher is unchanged; the 40 allow-list hashes are untouched. Refs #1087
The ten Farm contract types now sit in Modules/Farm/Contracts; the folder makes them contract, and a type with both fails. Refs #1087
The SPA's slug-pattern comment names Account.cs's path, and the UserRoleAssignments table-owner override reason names the namespace its CLR type remains in; both now name Modules/Farm/Accounts. The override itself is unchanged. Refs #1087
mforce
force-pushed
the
refactor/1087-farm-module
branch
from
October 6, 2026 01:19
74b1bd2 to
31b4b34
Compare
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1087
S7 of the package-by-module design: Farm moves into
Modules/Farmin Domain, Application and Api. This is a pure move with no behaviour change. Its repositories and EF configuration stay in place until S9.UserRoleAssignmentstays in Farm (Domain/Modules/Farm/Accounts), keeping itsUserRoleAssignmentstable-owner override (Access) and its seam entry. Rebased ontoccb55584(#1095, Access). I reset onto main and re-ran the codemod commit by commit (split, then move and prune, then marks). The hand-written comment and reason fixes cherry-picked unchanged. The re-key did not cherry-pick, because Access had re-keyed the neighbouringSymbollines, so it was re-applied to the rebased rows: the same 6 hash changes, with the guard reporting the same new hashes under Access's newSymbols. Proofs compare head31b4b347with baseccb55584.Review order
FarmLogoMetadata,FarmLogoContentandFarmBrandingHashesleaveIFarmLogoRepository.cs. Each is a verbatim slice.git mvs. Namespaces come from the folders, and the tool rewrote references, usings, ledger strings (including Farm'sSeam:IAccountRepository,Account,UserRoleAssignment), snapshot entity names and paths. The rules fileNamespacesnow holdsCluckwork.Domain.Modules.FarmandCluckwork.Application.Modules.Farm;Implementationsis unchanged (S9). No codemod fix was needed.IFarmModule's comment now names the Contracts folder (it was the last "types marked [ModuleContract]" comment).UserRoleAssignmentsoverride reason now nameModules/Farm/Accounts. The override row itself is unchanged.IdentityProvider, separately and with a namespace-only proof (below).[ModuleContract]marks deleted.Re-key proof (#632)
RequireActiveOwnerAsync,CountOtherActiveOwnersAsyncandDisableUserAsyncspellCluckwork.Domain.Accounts.Roles.Ownerin full inside their queries, so their token hashes follow the namespace. The names stay fully qualified (not shortened to a using), and the hasher is unchanged.GuardScanner.QuerySignatureOfonModules/Access/Identity/IdentityProvider.csatccb55584and at the head)RequireActiveOwnerAsyncdb.Roles,db.UserRolesaed7b297→71384910Cluckwork.Domain.Accounts.→Cluckwork.Domain.Modules.Farm.Accounts.CountOtherActiveOwnersAsyncdb.Roles,db.UserRoles57009ecd→b7bada95DisableUserAsyncdb.Roles,db.UserRoles9b6fec98→9e5764d7Each member gains exactly four tokens (
Modules . Farm .). No predicate changed. These are the three old→new pairs the design predicted and Astra measured. The 40 allow-list hashes are unchanged.Checks at push time (rebased head
31b4b347)dotnet build Cluckwork.slnArchitecture+TenantBypass+Documentation+ImagePinServingGuardCoverageTests(Farm's registration is its sentinel),TrackedMutationReadTests,AccountSuspensionTestsTenant-bypass registry, before and after (#632 keys)
Rows were parsed from
BypassAllowList.csandFilterFreeSetSites.csat baseccb55584(after Access's re-keys) and at head31b4b347; base rows were mapped through the move's type and path table.Hashmultiset identical: no allow-list hash changed (Farm has no allow-list row; none was re-keyed)Symbol,SetorReasonchanged, and no otherSignatureSignatures, all in the re-key commit with the namespace-only proof aboveTenantBypassRealTreeTestsgreen at the headProofs (base
ccb55584vs head31b4b347, re-run after the rebase)migrations has-pending-model-changesMigrations/diff is 4 snapshot lines namingAccountandUserRoleAssignmentunder their new namespaceccb55584'sAppDbContextModelSnapshot.csat the head)HasMaxLength(Account.MaxNameLength + 1): exit 1 ("Changes have been made to the model")tools/schema-docs/generate.sh --checkModules.Farm.ContractsUserRoleAssignmentsstill Access by override; Farm's tables still Farm)FarmModuleServiceCollectionExtensions.AddFarmModuleis now under the adapter rootCluckwork.Api.Modules, with empty reach and the persistence ban passingcoupling-matrix.mdCouplingMatrixRealTreeTestsgreen)Domain.Accounts,Application.Features.Accounts,Api.Endpoints.Accounts). One newly unused:global using Cluckwork.Domain.Common.Architecture;inCluckwork.Application/GlobalUsings.cs, because Farm's were the last Application[ModuleContract]marks. The design deletes it in S10Mutations (re-run on the rebased head in a spare worktree; each case reset, built and run against the
Architecture+TenantBypassfilter)Contracts/UpdateFarmSettingsCommand.cs(file and namespace) back toAccounts/UpdateFarmSettings/AdapterReachRealTreeTests,CouplingMatrixRealTreeTestsUpdateFarmSettingsCommand.Contractsnamespace keptNamespaceFolderAgreementTestsonlyAccountEndpoints.GetAccountinjects the seamIAccountRepository(adapters never get the seam)AdapterReachRealTreeTests,CouplingMatrixRealTreeTestsCreateExpenseHandleralso takesIFarmLogoRepository(neither contract nor seam); built with warnings not treated as errors, because the unread parameter is otherwise a build errorPeerContractRealTreeTestsRequireActiveOwnerAsync'sr.Name == …Roles.Owner→…Roles.ManagerTenantBypassRealTreeTests.RealSourceTree_FilterFreeSetSitesAreStableAndClassified/* probe */comment added inside the query