Repository navigation
refactor(arch): move the 7 login records into Access's public contract - #1104
Merged
Merged
Conversation
FarmSignIn, RefreshTokenRevocationOutcome, TokenPair, UserSummary, UserProfile, StepUpGrant and StepUpErrorCodes move unchanged from Application/Common to Application/Modules/Access/Contracts. Access produces all seven; six appear in IAccessModule signatures and the HTTP adapters map StepUpErrorCodes.Required to a response. UserProfile keeps Commerce's published EggUnit and is declared on the existing Access -> Commerce edge. AuthEndpoints.LegacyUpgradeResult gets an adapter row for its existing TokenPair parameter. The coupling matrix is regenerated and decision record 857 is amended. Closes #1103
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.
Moves the 7 login records that #1095 left in shared Platform code into Access's public contract, unchanged. No behavior, wire-format or schema change.
Closes #1103
TL;DR
FarmSignIn,RefreshTokenRevocationOutcome,TokenPair,UserSummary,UserProfile,StepUpGrantandStepUpErrorCodesmove fromApplication/CommontoApplication/Modules/Access/Contracts/. Access produces all seven. Six appear inIAccessModulesignatures, and the HTTP adapters mapStepUpErrorCodes.Requiredto a response. The guards then ask for two declarations, and this PR adds both:UserProfilekeeps Commerce's publishedEggUnit?. It is declared as one more symbol on the existing Access → Commerce row (CW1001 otherwise), as Farm'sFarmSettingsDetailsalready does.AuthEndpoints.LegacyUpgradeResultalready takes aTokenPair. Now thatTokenPairis an Access contract type, the reach needs a row; its siblingsLogin,Refresh,Logout,StepUpandChangePasswordalready have identical rows.Change map (20 files, +31/−22)
Application/Common/<T>.cs→Application/Modules/Access/Contracts/<T>.csnamespaceline changes.src/Cluckwork.Domain/Common/Architecture/Modules/Access.cstests/.../Architecture/RealModuleLedger.Adapters.cstests/.../Architecture/Data/coupling-matrix.mdW (7)→W (8); adapter rows reaching AccessA (28)→A (29). Regenerated withCLUCKWORK_REGENERATE_MATRIX=1.IIdentityProvider,IStepUpGrantService,IdentityProvider,JwtTokenService,StepUpGrantService, 3 integration test files+using …Access.Contracts(8),-using …Application.Commonwhere now unused (5). No body changes.Api/Modules/Access/Users/UserEndpoints.csCluckwork.Application.Common.StepUpErrorCodes.Required→StepUpErrorCodes.Required(the file's other 2 references were already short).docs/decisions/857-access-contract.mdNot changed:
UserSummaryandAccessUserSummaryare not renamed. The existing reason text on the Access → Commerce row still saysDomain.Catalog.EggUnit, as the Farm row does. Only the new sentence uses the currentCluckwork.Domain.Modules.Commerce.Contracts.EggUnitname, so fixing those older names stays out of this move.Decision
Spike: owner-approved and reviewed by Astra. Rejected alternatives:
UserProfile→ Commerce coupling and the adapter reach go untracked.PreferredStepperUnittostring?drops the compile-time dependency but loses type safety, and it still exposes Commerce's names.AccountProvisionerinsertsEggUnitConversion.Defaults.Proofs
Base:
origin/main23bb1921. Head:aa02aedd. I measured every row on this machine; the logs are in the coordinator workspace underreviews/1103-proofs/.Cluckwork.sln(warnings are errors)dotnet buildApplication.Tests~Architecture|~TenantBypassnamespacenamespaceline swapped vs head's file, sha256Application/Commongit cat-file -e HEAD:…/Common/<T>.cs/openapi/v1.jsonon base and headb3ca54f0…IServiceCollection(service type, lifetime, key, implementation type/factory/instance)90925ea9…BypassAllowList.csandFilterFreeSetSites.cs;git diffofTenantBypass/git diffofcoupling-matrix.mdW (7)→W (8)(×2 views), Access adapter rowsA (28)→A (29)(×2 views)dotnet testeach,DOTNET_USE_POLLING_FILE_WATCHER=1, undersg dockeraa02aeddThe OpenAPI document holds request schemas only, so it cannot show a response change by itself. Response shapes are covered by the mapping instead: no endpoint serializes any of the 7. Each is copied into an unchanged API type (
AccessTokenResponse,StepUpResponse,UserResponse,MeResponse), andMeEndpointsTests,AuthCookieContractTestsandStepUpAuthTestsassert those bodies.Mutations
"…Access.Contracts.UserProfile"symbol from the Access → Commerce rowUserProfile.cs(7,5): error CW1001: undeclared cross-owner edge Access -> Commerce from Cluckwork.Application.Modules.Access.Contracts.UserProfile— 1 errorAuthEndpoints.LegacyUpgradeResultadapter rowAdapterReachRealTreeTests.RealSourceTree_EveryAdapterReachIsDeclaredred:undeclared adapter reach …AuthEndpoints.LegacyUpgradeResult -> Access through …Access.Contracts.TokenPairI restored the tree after each mutation (
git statusclean).