Repository navigation
refactor: concept folders — one ASCKit module, Internal/ implementations - #45
Merged
Merged
Conversation
…nal/ Concept folders instead of Domain/Infrastructure layers: public face at the top, implementations in Internal/, the bare outside call in Internal/System/. Roles named for what they are (no Service/Manager/ Repository suffixes), a canonical-model step and the five domain questions (references/domain-shape.md), no approval gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Domain/ and Infrastructure/ (two modules mirroring each other) become Sources/ASCKit/<Concept>/ with each implementation in the concept's Internal/. DomainTests + InfrastructureTests become ASCKitTests, same layout. Pure move: 2,913 tests unchanged and green. Library users replace import Domain / import Infrastructure with import ASCKit. Design: docs/features/concept-folders/design.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md, CONTRIBUTING.md, docs/design.md, the implement-feature, fix-bug and improvement skills, and the feature designs' file maps now point at Sources/ASCKit/<Concept>/ and its Internal/, and at Tests/ASCKitTests/. Step 2 of docs/features/concept-folders/design.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commands and RESTRoutes ask ClientProvider for a concept's public protocol instead of building FileAuthStorage, EnvironmentAuthProvider, ProcessXcodeBuildRunner, FileProjectConfigStorage, the screenshot repositories or their own ClientFactory. CompositionRootTests holds the fence: it fails, naming file and type, when any other ASCCommand file names an ASCKit Internal/ type. Step 3 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WalkthroughWarning Review details and warnings were omitted to fit the comment limit. |
ShellCommand owns what SystemShellRunner used to decide inline: argv via /usr/bin/env, the environment merge, exit status -> executionFailed and output trimming, all now unit-tested. SystemShellRunner moves to Skills/Internal/System/ and keeps only the Process and pipe calls. codecov skips Sources/**/Internal/System/** by one rule instead of the file. Step 4 of the concept-folders design, rescoped to the seven untested adapters (the SDK adapters are already split via APIClient). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ession call IrisRequest builds every iris request (the iris/v1 URL, JSON:API, cookie, CSRF and user-agent headers; downloads with cookies only) and IrisResponse decides what a reply means (2xx body, httpError with status and body, invalidResponse), both unit-tested. IrisClient moves to Iris/Internal/System/ and keeps only session.data(for:). IrisAPIError, which REST controllers catch, moves to the Iris/ public face. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t reads BrowserIrisCookieProvider keeps its decisions — ASC_IRIS_COOKIES first when not blank, only the nine iris cookies, the first browser holding myacinfo, the cookie count — now tested through MockBrowserCookieStores. SweetCookieKitStores in Iris/Internal/System/ only reads each browser's stores. The cookie header is sorted by name instead of dictionary order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ystem/ With IrisClient's URLSession call in Iris/Internal/System/, nothing in IrisSDKAppBundleRepository is untestable: its query, decoding, mapping (fallback name, en-US default) and refusals are now pinned through a stubbed URLProtocol, and codecov no longer skips AppBundles/Internal/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LocalImages owns which src values are local images, where to find them (absolute, working directory, .asc/app-shots/, the web server's /api/files/read URLs) and their MIME types, unit-tested with an in-memory file reader; each file is now read once. WebKitHTMLRenderer moves to Screenshots/Internal/System/ and keeps only the WKWebView load and snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TTP clients IrisAuthSDKRepository depends on AppleIDSignIn (idmsa) and AppStoreConnectAccounts (olympus), played by IdmsaAPIClient and OlympusClient, plus an injected clock. Its decisions — the pending two-factor state, the session it builds (team, Apple ID as fallback email, 30-day expiry) and both login paths — are now tested with MockAppleIDSignIn / MockAppStoreConnectAccounts instead of a URLProtocol stub. codecov no longer skips Iris/Internal/Auth/ (77% covered; IdmsaAPIClient's own wire at 46% is the gap). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IrisAPI (get, post, download, delete) is what the iris repositories need from iris; IrisClient in Internal/System/ plays it. The four iris repositories take any IrisAPI (defaulting to IrisClient), and the app-bundle tests stub MockIrisAPI by path, query and cookies instead of a URLProtocol stub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… download roles PluginMarketRepository keeps its decisions — installed matching by slug or name-as-id, search, outdated versions, uninstall's match order, update as reinstall — now tested with MockPluginsFolder and MockPluginDownloads. LocalPluginsFolder and URLSessionPluginDownloads in Plugins/Internal/System/ hold only the PluginLoader, file system, unzip and URLSession calls. Completes step 4 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 repository protocols become collection nouns — the plural of the aggregate they hold (Apps, Builds, AppStoreVersions, AppScreenshots) — or role nouns where they aren't collections (IrisSignIn, TestFlight, GameCenter, Reports, AppPrices, ReviewSubmissions, *ReviewAssets). Implementations say how (SDKBuilds, SimctlSimulators, MarketplacePlugins); generated mocks, make* factories and file names follow. CLAUDE.md and the implement-feature skill state the rule. No behaviour change: 2,958 tests before and after. Step 5 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the blanket rename of step 5 (258cf42, 83d7b0e): the 64 protocols that are CRUD over an aggregate keep XxxRepository. The 11 that run a workflow take role nouns — IrisSignIn, Reports, ReviewSubmissions, InAppPurchaseSubmissions, SubscriptionSubmissions, IrisInAppPurchaseSubmissions, AppWall, Simulators, Skills, Plugins, Themes — with their implementations, mocks and make* factories. CLAUDE.md and both implement-feature skills state the rule. No behaviour change: 2,958 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SubmissionRepository, InAppPurchaseSubmissionRepository, SubscriptionSubmissionRepository and IrisInAppPurchaseSubmissionRepository are CRUD over a submission resource (submit is create or an isSubmitted update), so they keep the Repository name they had on main; their implementations, mocks and make* factories follow. The one workflow in them, SubmissionRepository.submitVersion, moves to the domain next. CLAUDE.md and the implement-feature skill say where a workflow over aggregates lives: a method on the model, built from repository primitives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ditable AppStoreVersion.submitForReview(to:) runs the submit workflow from the SubmissionRepository's primitives: its app's open draft for its platform, the version added unless the draft holds it, the draft submitted. It refuses a version that can't be edited (the same isEditable that offers the submitForReview affordance) before anything reaches Apple: versionNotEditable names the state and which states can go. asc versions submit and POST /api/v1/versions/:id/submit both load the version and call it; REST answers that refusal with 422. SubmissionRepository.submitVersion, which re-fetched the version and duplicated createSubmission's find-or-create inside the adapter, is gone. createSubmission now explains Apple's refusal to open a draft, as submitVersion did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hanrw
marked this pull request as ready for review
November 19, 2026 13:12
DataProvider.fetch answers null when the command fails and only logs the reason, so the Submissions page showed 'Submitted for App Store Review!' even when versions submit was refused (a version that can't be edited, or Apple's refusal). It now shows an error toast pointing to the command log. Mock mode is unaffected: it never answers null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Lays
asc-cliout by concept instead of by layer, following docs/features/concept-folders/design.md. Each step from that design lands on this branch; draft until all steps are in.Done
Step 1: one module, concept folders.
Sources/Domain+Sources/Infrastructure→Sources/ASCKit/<Concept>/with each implementation in the concept'sInternal/.DomainTests+InfrastructureTests→ASCKitTests, same layout. Pure move (git mv, history kept): 2,913@Tests before and after, all green.Step 2: docs and skills follow.
CLAUDE.md,CONTRIBUTING.md,docs/design.md, theimplement-feature/fix-bug/improvementskills and the feature designs' file maps describe the new tree.Step 3: one composition root. Commands and
RESTRoutesaskClientProviderfor a concept's public protocol instead of building implementations (22 uses of 12 types in 14 files).CompositionRootTestsfails, naming file and type, if any otherASCCommandfile names anInternal/type.The
app-implement-featureskill describes the pattern (concept folders, role names, canonical model,domain-shape.md).Step 4: the bare call in
Internal/System/. The SDK adapters were already split (they depend on the narrowAPIClientrole; 472 tests drive them throughStubAPIClient). The seven untested adapters that weren't now keep their decisions in testedInternal/types or behind@Mockableroles, with only the call inInternal/System/(16–82 lines each):ShellCommand/SystemShellRunnerIrisRequest+IrisResponse/IrisClient, which plays the new@Mockable IrisAPIroleBrowserIrisCookieProvidervia@Mockable BrowserCookieStores/SweetCookieKitStoresIrisAuthSDKRepositoryvia@Mockable AppleIDSignIn+AppStoreConnectAccounts(both login paths now tested)LocalImages/WebKitHTMLRendererPluginMarketRepositoryvia@Mockable PluginsFolder+PluginDownloads/LocalPluginsFolderIrisSDKAppBundleRepositorytested onMockIrisAPIcodecov.ymlskipsSources/**/Internal/System/**by one rule instead of six per-file entries; the blanketIris/Internal/Auth/**skip is gone (77% covered).Step 5: names for roles.
XxxRepositorystays for the 68 CRUD protocols (a state change like submit is an update). The 7 that run something outside asc-cli take role nouns:IrisSignIn,Reports,AppWall,Simulators,Skills,Plugins,Themes. The one workflow hiding in a repository moved to the model:AppStoreVersion.submitForReview(to:)replacesSubmissionRepository.submitVersion.Behaviour change
asc versions submitandPOST /api/v1/versions/:id/submitnow refuse a version that can't be edited (e.g. Ready for Sale) before calling Apple — REST answers 422 — saying which states can go to review. Previously the request went to Apple and failed there.Breaking (library only)
ASCKitis now one module: replaceimport Domain/import Infrastructurewithimport ASCKit. Seven protocols take role names (IrisAuthRepository→IrisSignIn, …), andSubmissionRepository.submitVersionbecomesAppStoreVersion.submitForReview(to:). CHANGELOG has the lines.Test plan
swift test: 2,170 + 791 tests passmake check-docs: 0 problemsexamples/hello-pluginbuilds againstASCKit🤖 Generated with Claude Code