Repository navigation
refactor(arch): move Egg Operations into Modules/EggOperations - #1093
Merged
Merged
Conversation
…files move.py split: the four Domain contract enums leave DailyEntry.cs, EggGrade.cs and EggInventoryMovement.cs, and eleven Application contract records leave four handlers, IEggLotRepository.cs and SaleAllocationPlanner.cs, 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/EggOperations, contract types (including the four Domain enums) under Contracts, with the namespace taken from the folder. The Stock endpoints go with Egg Operations, the module they reach. The current model snapshot follows the moved entities; historical migrations and Designer files are untouched. The rules file now names Cluckwork.Domain.Modules.EggOperations and Cluckwork.Application.Modules.EggOperations; Implementations stay for S9. move.py prune drops the usings the move left unused. Refs #1087
…gOperations docs/architecture.md names the two handlers by layer-relative path, which the codemod's project-relative rewrite does not match. Refs #1087
The thirty-three Egg Operations contract types now sit in Contracts folders (Domain's four enums, Application's twenty-nine types); the folder makes them contract, and a type with both fails. Refs #1087
mforce
force-pushed
the
refactor/1087-egg-operations-module
branch
from
October 5, 2026 22:34
f047fe6 to
52c8835
Compare
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
S5 of the package-by-module design: Egg Operations moves into
Modules/EggOperationsin Domain, Application and Api. This is a pure move with no behaviour change. Its repositories and EF configurations stay in place until S9. Proofs compare this head52c88352with the base541eca98(#1092 merged). The branch was rebuilt on that base by re-running the codemod for every commit, not by hand-merging.Review order
DailyEntryStatus(fromDailyEntry.cs);EggGradeTypeandDailyEntryKind(fromEggGrade.cs);EggMovementType(fromEggInventoryMovement.cs).AdjustDailyEntryResponse,SubmitDailyEntryResponse,VoidDailyEntryResponse,DailyEntryLockPass,LockedDailyEntry,RefusedDailyEntryLock,StockByGrade,RecordEggLotMovementResult,SaleDemandLine,PlannedEggLotDraw,SaleAllocationPlan.git mvs, with namespaces taken from folders.tools/module-move/move.pyrewrote references, usings, ledger strings, snapshot entity names and paths.prunethen dropped the usings the move left unused. The rules file'sNamespacesnow holdsCluckwork.Domain.Modules.EggOperationsandCluckwork.Application.Modules.EggOperations.Implementationsis unchanged until S9.docs/architecture.mdthat the codemod's project-relative rewrite does not match.[ModuleContract]marks (4 Domain, 29 Application).This slice needed no codemod change.
Change map
Domain/Eggs/{DailyEntry,EggGrade,EggInventoryMovement,EggLot}.csDomain/Modules/EggOperations/Eggs/DailyEntryStatus,EggGradeType,DailyEntryKind,EggMovementType(split out)Domain/Modules/EggOperations/Contracts/Application/Features/{DailyEntries,EggGrades,EggLots,Eggs}/**contracts (11 whole files, 18 types; 11 split types)Application/Modules/EggOperations/Contracts/(29 types)Application/Features/{DailyEntries,EggGrades,EggLots,Eggs}/**handlers, validators, lookups,EggStock,EggOperationsModule,SaleAllocationPlanner, repository portsApplication/Modules/EggOperations/{DailyEntries,EggGrades,EggLots,Eggs}/**Api/Endpoints/{DailyEntries,EggGrades,Stock}/*.cs,Api/Hosting/Modules/EggOperationsModuleServiceCollectionExtensions.csApi/Modules/EggOperations/: Platform-owned adapters.Stockgoes with the module it reaches.AppDbContextModelSnapshot.cs: 19 entity-name linesChecks at the head (base measured on
541eca98)dotnet build Cluckwork.slnArchitecture+TenantBypass+Documentation+ImagePinServingGuardCoverageTests,TrackedMutationReadTests,InsightsReadOnlyTestsProofs (base
541eca98vs head52c88352)migrations has-pending-model-changesMigrations/diff is the 19 snapshot entity-name lines. Control:HasMaxLength(DailyEntry.MaxReasonLength + 1)onAdjustReasonmakes the same command exit 1tools/schema-docs/generate.sh --checkContracts, 29 in ApplicationContracts)DailyEntries,DailyEntryGrades,EggGrades,EggInventoryMovements,EggLotsstill Egg Operations)AddEggOperationsModuleis now under the adapter root (walked 406 → 407), with empty reach, and the persistence ban passescoupling-matrix.mdCouplingMatrixRealTreeTestsgreen)Application.Features.DailyEntriesandDomain.EggsnamespacesThe type map covers every top-level declaration in the 60 moved files, read at the split commit. The report comparison excludes positions (file, line).
CI at
52c8835218 checks pass, including the four test legs, "Build, audit and schema docs", both image smoke tests and the three Playwright shards. "Publish the commit image" is skipped, as on every PR.
Mutations
Each case ran in a spare worktree at the head. It was reset, built, and run against the
Architecture+TenantBypassfilter.Contracts/VoidDailyEntryCommand.cs(file and namespace) back toDailyEntries/VoidDailyEntry/AdapterReachRealTreeTests,CouplingMatrixRealTreeTestsVoidDailyEntryCommand.Contractsnamespace keptNamespaceFolderAgreementTestsonlyContracts/DailyEntryStatus.csback toDomain/Modules/EggOperations/Eggs/DailyEntryStatusDailyEntryEndpointsalso injectsIDailyEntryRepositoryAdapterReachRealTreeTests,CouplingMatrixRealTreeTestsEggGradeFloorPolicyreferences Commerce'sSalesOrder(no Egg Operations → Commerce edge)CW1001: undeclared cross-owner edge EggOperations -> Commerce. With analyzers off: redModuleLedgerRealTreeTests,CouplingMatrixRealTreeTests(2)ConfirmSaleHandleralso takesIEggLotRepository, which is outside the Egg Operations contractPeerContractRealTreeTestsAdjustDailyEntryResponsegains aDailyEntryaggregate propertyModuleContractRealAssemblyTestsNote on M1c (a gap that already exists, not a regression). No adapter or peer takes any of the four Egg Operations Domain enums as a parameter or service resolution. They are reached only inside Egg Operations' own contract records, such as
DailyEntryDetails.Status, and the walks never read return types or members. Flock Management's M1c went red becauseFlockEndpointsreachesFlockStatusdirectly. Here, taking an enum out of the contract turns no guard red. Only the contract-set parity above catches it. Removing the mark fromDailyEntryStatusonmainwould be equally green. No guard checks that a contract type exposes only contract types of its own module. That rule would be a separate decision, so it is not part of this move.