Skip to content

refactor(types): readonly domain types full stack (replaces #307) - #386

Merged
YosefHayim merged 12 commits into
mainfrom
refactor/foundation/readonly-types-full
Aug 7, 2026
Merged

refactor(types): readonly domain types full stack (replaces #307)#386
YosefHayim merged 12 commits into
mainfrom
refactor/foundation/readonly-types-full

Conversation

@YosefHayim

@YosefHayim YosefHayim commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Re-split replacement for HOLD #307. 12 domain commits on one green tip.

Domains: types → apple → google → providers → store → build → credentials → config → release → readiness → services → cli-agents.

Stack PRs also opened as readonly-stack-0112 for domain review. This tip PR is the landable unit.

Supersedes

Closes #307.

Test plan

  • typecheck / lint:style / test / build on tip

Summary by cubic

Refactored the codebase to use readonly domain types end-to-end and introduced a MutableDeep helper for safe, local mutation during object construction. Updated APIs to accept/return readonly data for clearer intent and fewer accidental mutations, with no runtime behavior changes.

  • Refactors

    • Converted domain models and schemas to readonly; removed Schema.mutable wrappers.
    • Added MutableDeep and applied it when building objects (e.g., config, build context, credentials, listings).
    • Switched many parameters/returns to readonly arrays/maps across CLI, build, credentials, store, snapshot, release, and services.
    • Minor cleanups and type narrowings (e.g., schema and snapshot JSON handling) to align with readonly shapes.
  • Migration

    • Pass readonly arrays to functions (e.g., use as const or avoid mutating inputs).
    • When assembling objects for readonly types, create local drafts with MutableDeep<...>.
    • No CLI or config changes required.

Written for commit d0c226d. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d0c226d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters.

If you still want a review, comment @codeant-ai : review. For better signal, consider splitting the PR into smaller chunks.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

refactor(types): enforce readonly domain types across the full stack

✨ Enhancement 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Convert domain type exports to Readonly shapes and readonly arrays for immutability-by-default.
• Add a MutableDeep helper and update consumers to clone before mutating or calling SDKs.
• Remove Schema.mutable usage and adjust build/store/snapshot/release flows to compile cleanly.
Diagram

graph TD
  Types["core/types (readonly)"] --> Core["Core domains"] --> CLI["CLI / Agents"]
  Types --> AppleClient["Apple ASC client"] --> AppleAPI{{"App Store Connect"}}
  Types --> GoogleClient["Google Play client"] --> GoogleAPI{{"Google Play"}}
  Types --> Providers["Providers"]
  Core --> AppleClient
  Core --> GoogleClient
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Adopt a utility type library for deep mutability
  • ➕ Avoid maintaining a custom MutableDeep implementation
  • ➕ Potentially better edge-case coverage (maps/sets, branded types, etc.)
  • ➖ Adds/expands a dependency for a purely type-level concern
  • ➖ May not match the project’s preferred semantics for functions/arrays/objects
2. Keep types readonly but introduce explicit DTO/request types at boundaries
  • ➕ Clarifies which shapes are internal immutable domain models vs mutable wire/request DTOs
  • ➕ Reduces need for deep cloning when calling generated SDKs
  • ➖ More code and more types to maintain (DTO duplication)
  • ➖ Can increase friction when mapping between similar shapes
3. Runtime immutability enforcement (deepFreeze) for boundary objects
  • ➕ Catches accidental mutation at runtime, not just compile time
  • ➕ Can uncover latent shared-reference bugs
  • ➖ Runtime cost and complexity; must be carefully scoped to avoid perf regressions
  • ➖ Still requires mutable request shapes for some SDKs, so cloning remains necessary

Recommendation: The PR’s approach (readonly-by-default domain types + explicit cloning via MutableDeep and targeted deep clones at SDK boundaries) is a pragmatic middle ground: it improves correctness and API clarity without introducing DTO duplication across every domain. If mutation hotspots grow, consider adding boundary-specific request DTOs for the Google/Apple SDK layers to reduce reliance on JSON clone patterns.

Files changed (133) +1379 / -1176

Refactor (120) +1353 / -1157
ascClient.tsAccept readonly inputs and build mutable request payloads +16/-12

Accept readonly inputs and build mutable request payloads

• Updates ASC client method signatures to accept readonly arrays and adjusts request construction to clone arrays/objects where payloads must be mutable.

src/apple/ascClient.ts

specPatch.tsUse readonly entry lists for spec selection +1/-1

Use readonly entry lists for spec selection

• Changes the spec entry picker to accept a readonly string array, aligning with readonly-by-default collection types.

src/apple/generated/specPatch.ts

completion.tsTreat completion words as readonly +1/-1

Treat completion words as readonly

• Updates the completion subcommand action signature to accept readonly words, matching upstream readonly argument typing.

src/cli/commands/completion.ts

testflight.tsReadonly typing alignment for TestFlight command plumbing +2/-2

Readonly typing alignment for TestFlight command plumbing

• Adjusts local typings to satisfy readonly domain types without changing command behavior.

src/cli/commands/testflight.ts

options.tsMake env option accumulator accept readonly previous flags +1/-1

Make env option accumulator accept readonly previous flags

• Updates the commander reducer signature to accept a readonly array and returns a new array for accumulation.

src/cli/options.ts

capabilities.tsReadonly consumer updates for adopt capabilities +1/-1

Readonly consumer updates for adopt capabilities

• Adjusts adopt capability code to align with readonly domain types and collections.

src/core/adopt/capabilities.ts

certs.tsReadonly consumer updates for adopt certificates flow +1/-1

Readonly consumer updates for adopt certificates flow

• Updates certificate adoption logic signatures/usages for readonly domain types.

src/core/adopt/certs.ts

configWriter.tsAvoid mutating draft product blocks during serialization +6/-4

Avoid mutating draft product blocks during serialization

• Refactors product-piece aggregation to return new objects conditionally rather than mutating a draft record, keeping readonly compatibility.

src/core/adopt/configWriter.ts

products.tsReadonly consumer updates for adopt products flow +2/-1

Readonly consumer updates for adopt products flow

• Adjusts product adoption logic to accept readonly collections where appropriate.

src/core/adopt/products.ts

appleTargets.tsReadonly typing adjustments in Apple target resolution +3/-1

Readonly typing adjustments in Apple target resolution

• Updates build target helpers to satisfy readonly domain types with no behavior change.

src/core/build/appleTargets.ts

artifactRetention.tsUse readonly artifact indexes and immutable updates +11/-6

Use readonly artifact indexes and immutable updates

• Updates artifact retention APIs/implementations to accept readonly artifact lists and prefer non-mutating array operations.

src/core/build/artifactRetention.ts

buildDiagnostics.tsReadonly typing alignment for diagnostics +1/-1

Readonly typing alignment for diagnostics

• Adjusts diagnostics interfaces/usage to match readonly domain collections.

src/core/build/buildDiagnostics.ts

buildHistoryCommand.tsReadonly typing alignment for build history output +2/-2

Readonly typing alignment for build history output

• Updates command plumbing types to satisfy readonly domain shapes.

src/core/build/buildHistoryCommand.ts

pipeline.tsClone readonly inputs into mutable drafts for build context assembly +26/-6

Clone readonly inputs into mutable drafts for build context assembly

• Introduces MutableDeep usage and explicitly builds mutable drafts (app, env, android release) before incremental mutation during build preparation.

src/core/build/pipeline.ts

pipelineEnv.tsReadonly typing alignment for pipeline env handling +3/-3

Readonly typing alignment for pipeline env handling

• Adjusts pipeline env types/usages to comply with readonly domain shapes.

src/core/build/pipelineEnv.ts

pipelineSigning.tsReadonly typing alignment for signing pipeline +6/-3

Readonly typing alignment for signing pipeline

• Updates signing pipeline types and array handling for readonly credentials/signing structures.

src/core/build/pipelineSigning.ts

pipelineTypes.tsReadonly typing alignment for pipeline types +3/-2

Readonly typing alignment for pipeline types

• Adjusts pipeline type declarations to use Readonly wrappers/readonly arrays where applicable.

src/core/build/pipelineTypes.ts

pipelineVersion.tsReadonly typing alignment for version resolution +3/-2

Readonly typing alignment for version resolution

• Updates version resolution types to be compatible with readonly domain values.

src/core/build/pipelineVersion.ts

remotePipeline.tsReadonly typing alignment for remote pipeline glue +2/-1

Readonly typing alignment for remote pipeline glue

• Adjusts remote pipeline interfaces to accept readonly collections as inputs.

src/core/build/remotePipeline.ts

config.tsReadonly typing alignment in config loader output +2/-1

Readonly typing alignment in config loader output

• Updates config-related typing to reflect readonly domain structures consumed downstream.

src/core/config/config.ts

env.tsReadonly typing alignment for environment parsing +4/-4

Readonly typing alignment for environment parsing

• Adjusts env parsing/serialization signatures to accept readonly collections.

src/core/config/env.ts

toolchain.tsReadonly typing alignment for toolchain resolution +3/-3

Readonly typing alignment for toolchain resolution

• Updates toolchain code to satisfy readonly domain types.

src/core/config/toolchain.ts

accounts.tsStop relying on mutable decoded schema; clone arrays when updating accounts +22/-25

Stop relying on mutable decoded schema; clone arrays when updating accounts

• Removes Schema.mutable usage and updates account mutations to use immutable updates/clones (e.g., apps list) with MutableDeep for construction.

src/core/credentials/accounts.ts

appleSigning.tsReadonly typing alignment for Apple signing helpers +3/-2

Readonly typing alignment for Apple signing helpers

• Updates signing helpers to accept/return readonly-friendly shapes and avoid mutating readonly structures.

src/core/credentials/appleSigning.ts

capabilities.tsReadonly typing alignment for capabilities credentials flow +1/-1

Readonly typing alignment for capabilities credentials flow

• Adjusts capability-related credential logic for readonly domain types.

src/core/credentials/capabilities.ts

pushKeyStore.tsReadonly typing alignment for push key storage +2/-1

Readonly typing alignment for push key storage

• Updates push key store helpers to accept readonly types and avoid in-place mutation.

src/core/credentials/pushKeyStore.ts

signingPreflight.tsReadonly typing alignment for signing preflight checks +5/-3

Readonly typing alignment for signing preflight checks

• Adjusts preflight logic signatures/usages to work with readonly credential shapes.

src/core/credentials/signingPreflight.ts

render.tsReadonly typing alignment for dashboard rendering inputs +4/-4

Readonly typing alignment for dashboard rendering inputs

• Updates dashboard renderer typing to match readonly domain structures.

src/core/dashboard/render.ts

updateHistory.tsReadonly typing alignment for distribution history updates +1/-1

Readonly typing alignment for distribution history updates

• Adjusts history update code for readonly collections.

src/core/distribution/updateHistory.ts

commandReference.tsReadonly typing alignment in docs generation +1/-1

Readonly typing alignment in docs generation

• Updates documentation generation types to accept readonly domain collections.

src/core/docs/commandDocs/commandReference.ts

common.tsReadonly typing alignment in docs helpers +1/-1

Readonly typing alignment in docs helpers

• Adjusts shared docs helper typings for readonly arrays/records.

src/core/docs/commandDocs/common.ts

command.tsReadonly typing alignment for doctor command plumbing +1/-1

Readonly typing alignment for doctor command plumbing

• Updates doctor command code to satisfy readonly domain types.

src/core/doctor/command.ts

command.tsReadonly typing alignment for insights command +3/-2

Readonly typing alignment for insights command

• Adjusts insights command typing to match readonly domain shapes.

src/core/insights/command.ts

apply.tsClone locale info when merging listing drafts over readonly store config +40/-8

Clone locale info when merging listing drafts over readonly store config

• Introduces MutableDeep for draft objects and adds an explicit merge helper to safely overlay draft fields (including keyword array cloning) onto existing locale info.

src/core/listing/apply.ts

generator.tsReadonly typing alignment for listing generation +2/-1

Readonly typing alignment for listing generation

• Updates listing generator inputs/outputs to accept readonly collections where appropriate.

src/core/listing/generator.ts

command.tsReadonly typing alignment for migrate command wiring +1/-1

Readonly typing alignment for migrate command wiring

• Adjusts migration command typings for readonly domain shapes.

src/core/migrate/command.ts

eas.tsReadonly typing alignment for EAS migration logic +3/-2

Readonly typing alignment for EAS migration logic

• Adjusts migration parsing/output shapes to conform to readonly domain types.

src/core/migrate/eas.ts

fastlane.tsUse MutableDeep for parsed Fastlane artifacts and avoid partial mutation +30/-11

Use MutableDeep for parsed Fastlane artifacts and avoid partial mutation

• Creates parsed objects via MutableDeep and refactors setup assembly to return new objects for optional combinations, aligning with readonly type outputs.

src/core/migrate/fastlane.ts

scaffold.tsReadonly typing alignment for scaffold helpers +1/-1

Readonly typing alignment for scaffold helpers

• Adjusts scaffold helper typing to match readonly domain types.

src/core/migrate/scaffold.ts

orchestrator.tsReadonly typing alignment for plan orchestrator +1/-1

Readonly typing alignment for plan orchestrator

• Updates orchestrator interfaces/usages to accept readonly plans and collections.

src/core/plan/orchestrator.ts

appStoreSurface.tsReadonly typing alignment for App Store surface planner +5/-2

Readonly typing alignment for App Store surface planner

• Updates planner typing to satisfy readonly domain plan definitions.

src/core/plan/planners/appStoreSurface.ts

euDistribution.tsReadonly typing alignment for EU distribution planner +2/-1

Readonly typing alignment for EU distribution planner

• Adjusts planner types/usages for readonly collections.

src/core/plan/planners/euDistribution.ts

gameCenter.tsReadonly typing alignment for Game Center planner +2/-1

Readonly typing alignment for Game Center planner

• Updates planner inputs/outputs to match readonly domain types.

src/core/plan/planners/gameCenter.ts

playProducts.tsReadonly typing alignment for Play products planner +1/-1

Readonly typing alignment for Play products planner

• Adjusts planner typing to accept readonly domain collections.

src/core/plan/planners/playProducts.ts

playSubscriptions.tsReadonly typing alignment for Play subscriptions planner +4/-1

Readonly typing alignment for Play subscriptions planner

• Updates planner code to satisfy readonly subscription plan types and arrays.

src/core/plan/planners/playSubscriptions.ts

wallet.tsReadonly typing alignment for Wallet planner +2/-1

Readonly typing alignment for Wallet planner

• Adjusts planner typing for readonly domain structures.

src/core/plan/planners/wallet.ts

parse.tsReadonly typing alignment for privacy parsing +1/-1

Readonly typing alignment for privacy parsing

• Updates privacy parsing types to match readonly domain definitions.

src/core/privacy/parse.ts

reconcile.tsReadonly typing alignment for privacy reconciliation +1/-1

Readonly typing alignment for privacy reconciliation

• Adjusts reconcile logic typing to accept readonly configs and arrays.

src/core/privacy/reconcile.ts

appScopes.tsReadonly typing alignment for readiness app scopes +2/-2

Readonly typing alignment for readiness app scopes

• Updates readiness scope helpers for readonly collections.

src/core/readiness/appScopes.ts

iapCodeReference.tsReadonly typing alignment for IAP code-reference probe +1/-1

Readonly typing alignment for IAP code-reference probe

• Updates probe typings for readonly domain structures.

src/core/readiness/probes/iapCodeReference.ts

profileEntitlements.tsReadonly typing alignment for profile entitlements probe +1/-1

Readonly typing alignment for profile entitlements probe

• Adjusts probe typing for readonly entitlements structures.

src/core/readiness/probes/profileEntitlements.ts

testflightFeedback.tsReadonly typing alignment for TestFlight feedback handling +1/-1

Readonly typing alignment for TestFlight feedback handling

• Updates feedback handling code to accept readonly inputs and avoid mutating readonly collections.

src/core/release/testflightFeedback.ts

version.tsReadonly typing alignment for release version utilities +1/-1

Readonly typing alignment for release version utilities

• Updates version helper typing to match readonly domain types.

src/core/release/version.ts

orchestrator.tsReadonly typing alignment for release-train orchestrator +8/-3

Readonly typing alignment for release-train orchestrator

• Adjusts orchestrator typing and collection handling for readonly release-train record shapes.

src/core/releaseTrain/orchestrator.ts

record.tsRemove Schema.mutable wrappers for release-train record persistence +35/-41

Remove Schema.mutable wrappers for release-train record persistence

• Refactors Effect Schema definitions to produce readonly shapes directly, matching the updated TrainRecord types.

src/core/releaseTrain/record.ts

appleCredentialsClient.tsReadonly typing alignment for Apple credentials client surface +1/-1

Readonly typing alignment for Apple credentials client surface

• Updates service typing to accept/return readonly credential shapes.

src/core/services/appleCredentialsClient.ts

artifactRetention.tsReadonly typing alignment for artifact retention service interface +2/-2

Readonly typing alignment for artifact retention service interface

• Updates signatures to accept readonly artifact collections and follow immutable update patterns.

src/core/services/artifactRetention.ts

localCredentialsStore.tsReadonly typing alignment for local credentials store +1/-1

Readonly typing alignment for local credentials store

• Adjusts local credential store typing to match readonly domain types.

src/core/services/localCredentialsStore.ts

logger.tsReadonly typing alignment for logger helpers +2/-2

Readonly typing alignment for logger helpers

• Adjusts logger helper typing for readonly arrays/records passed through logging.

src/core/services/logger.ts

progress.tsAccept readonly args/tails in progress runner +6/-2

Accept readonly args/tails in progress runner

• Updates progress runner and failure reporting signatures to accept readonly arrays while preserving behavior.

src/core/services/progress.ts

sandbox.tsReadonly typing alignment for sandbox service APIs +1/-1

Readonly typing alignment for sandbox service APIs

• Updates sandbox service typing to accept readonly domain shapes.

src/core/services/sandbox.ts

ssh.tsReadonly typing alignment for SSH service APIs +1/-1

Readonly typing alignment for SSH service APIs

• Adjusts SSH service typing for readonly inputs.

src/core/services/ssh.ts

orchestrator.tsReadonly typing alignment for snapshot orchestrator +1/-1

Readonly typing alignment for snapshot orchestrator

• Updates orchestrator typing to operate on readonly snapshot context and report structures.

src/core/snapshot/orchestrator.ts

snapshotCommand.tsReadonly typing alignment for snapshot command plumbing +4/-4

Readonly typing alignment for snapshot command plumbing

• Adjusts snapshot command input/output typing for readonly snapshot structures.

src/core/snapshot/snapshotCommand.ts

appleListing.tsUse readonly localization lists and stricter JsonValue narrowing +22/-10

Use readonly localization lists and stricter JsonValue narrowing

• Updates Apple listing capture/restore helpers to accept readonly arrays and adds explicit JsonValue object guards to satisfy readonly record typing.

src/core/snapshot/sources/appleListing.ts

appleProducts.tsReadonly typing alignment for Apple products snapshot source +5/-7

Readonly typing alignment for Apple products snapshot source

• Adjusts Apple products snapshot source typing to accept readonly collections and domain shapes.

src/core/snapshot/sources/appleProducts.ts

appleSubscriptions.tsReadonly typing alignment for Apple subscriptions snapshot source +5/-7

Readonly typing alignment for Apple subscriptions snapshot source

• Updates Apple subscriptions snapshot code for readonly arrays/records.

src/core/snapshot/sources/appleSubscriptions.ts

playProducts.tsReadonly typing alignment for Play products snapshot source +3/-2

Readonly typing alignment for Play products snapshot source

• Adjusts Play products snapshot source typing for readonly domain collections.

src/core/snapshot/sources/playProducts.ts

playRestore.tsReturn readonly Json records and add JsonValue record guard +16/-5

Return readonly Json records and add JsonValue record guard

• Introduces an explicit JsonValue-to-record type guard and updates helpers to return readonly record types for snapshot restore parsing.

src/core/snapshot/sources/playRestore.ts

playSubscriptions.tsReadonly typing alignment for Play subscriptions snapshot source +3/-3

Readonly typing alignment for Play subscriptions snapshot source

• Updates Play subscriptions snapshot source to accept readonly collections and avoid mutating readonly shapes.

src/core/snapshot/sources/playSubscriptions.ts

store.tsRemove Schema.mutable wrappers for snapshot persistence schemas +36/-50

Remove Schema.mutable wrappers for snapshot persistence schemas

• Refactors snapshot store schemas to produce readonly arrays/records directly (no Schema.mutable), aligning with readonly snapshot domain types.

src/core/snapshot/store.ts

accessibility.tsReadonly typing alignment for accessibility reconciliation +2/-1

Readonly typing alignment for accessibility reconciliation

• Updates store accessibility reconciliation code to satisfy readonly catalog/listing shapes.

src/core/store/accessibility.ts

appEvents.tsReadonly typing alignment for app events reconciliation +3/-2

Readonly typing alignment for app events reconciliation

• Adjusts app events logic for readonly domain collections.

src/core/store/appEvents.ts

ascScreenshots.tsReadonly typing alignment for screenshot reconciliation +5/-5

Readonly typing alignment for screenshot reconciliation

• Updates screenshot reconciliation typing for readonly arrays and resource shapes.

src/core/store/ascScreenshots.ts

ascSync.tsReadonly typing alignment for ASC sync surfaces +2/-2

Readonly typing alignment for ASC sync surfaces

• Adjusts ASC sync code to accept readonly catalogs/configs and avoid in-place mutation of readonly structures.

src/core/store/ascSync.ts

availability.tsReadonly typing alignment for availability reconciliation +1/-1

Readonly typing alignment for availability reconciliation

• Updates availability reconciliation typing to accept readonly territory lists and configs.

src/core/store/availability.ts

gameCenter.tsReadonly typing alignment for Game Center reconciliation +6/-5

Readonly typing alignment for Game Center reconciliation

• Adjusts Game Center reconciliation code for readonly domain types.

src/core/store/gameCenter.ts

offers.tsAccept readonly offer configs and construct mutable create payloads +19/-15

Accept readonly offer configs and construct mutable create payloads

• Updates offer reconciler signatures to take readonly config arrays and uses MutableDeep when building create payloads sent to ASC.

src/core/store/offers.ts

playProducts.tsReadonly typing alignment for Play products reconciliation +2/-1

Readonly typing alignment for Play products reconciliation

• Adjusts Play products reconciler typing for readonly product configs and collections.

src/core/store/playProducts.ts

playSubscriptions.tsReadonly typing alignment for Play subscriptions reconciliation +20/-17

Readonly typing alignment for Play subscriptions reconciliation

• Updates subscription reconciliation typing and array handling to work with readonly domain definitions.

src/core/store/playSubscriptions.ts

playTracks.tsReadonly typing alignment for Play tracks reconciliation +2/-1

Readonly typing alignment for Play tracks reconciliation

• Adjusts Play track reconciliation typing for readonly track/release structures.

src/core/store/playTracks.ts

reconcile.tsUse MutableDeep PlannedAction handles for status mutation +17/-5

Use MutableDeep PlannedAction handles for status mutation

• Updates reconciliation context/actions to store mutable handles while keeping exported PlannedAction types readonly; summarize now accepts readonly arrays.

src/core/store/reconcile.ts

reportsCommand.tsReadonly typing alignment for reports command +3/-2

Readonly typing alignment for reports command

• Updates reports command typing to operate on readonly collections and domain records.

src/core/store/reportsCommand.ts

syncJobs.tsReadonly typing alignment for sync job definitions +3/-3

Readonly typing alignment for sync job definitions

• Adjusts sync job typing to accept readonly job lists and avoid mutating readonly configs.

src/core/store/syncJobs.ts

syncRun.tsReadonly typing alignment for sync run execution +9/-3

Readonly typing alignment for sync run execution

• Updates sync run typing and local drafts to match readonly domain shapes.

src/core/store/syncRun.ts

team.tsReadonly typing alignment for team-related store operations +1/-1

Readonly typing alignment for team-related store operations

• Adjusts team helpers for readonly arrays/records.

src/core/store/team.ts

walletIds.tsReadonly typing alignment for wallet ID reconciliation +1/-1

Readonly typing alignment for wallet ID reconciliation

• Updates wallet ID logic typing for readonly domain shapes.

src/core/store/walletIds.ts

completion.tsReadonly typing alignment for terminal completion +1/-1

Readonly typing alignment for terminal completion

• Updates terminal completion typing to accept readonly word arrays.

src/core/terminal/completion.ts

halfblock.tsReadonly typing alignment for terminal rendering helper +1/-1

Readonly typing alignment for terminal rendering helper

• Adjusts terminal helper typing for readonly inputs.

src/core/terminal/halfblock.ts

wizardCommand.tsReadonly typing alignment for wizard command plumbing +2/-2

Readonly typing alignment for wizard command plumbing

• Updates wizard command typing to match readonly domain definitions.

src/core/terminal/wizardCommand.ts

adopt.tsMake adopt domain types Readonly and return readonly collections +36/-30

Make adopt domain types Readonly and return readonly collections

• Wraps adopt types/APIs in Readonly and converts collection fields/returns to readonly arrays to enforce immutability at the boundary.

src/core/types/adopt.ts

agents.tsMake agents/skills domain types Readonly +33/-33

Make agents/skills domain types Readonly

• Converts agent skill/rule types to Readonly and updates array fields to readonly arrays for safer sharing.

src/core/types/agents.ts

appleCatalog.tsMake Apple catalog resource types Readonly +179/-178

Make Apple catalog resource types Readonly

• Wraps Apple catalog resource types in Readonly and converts nested arrays to readonly arrays throughout the catalog model.

src/core/types/appleCatalog.ts

artifacts.tsMake artifacts domain types Readonly +11/-11

Make artifacts domain types Readonly

• Converts artifact-related domain types to Readonly and updates list fields to readonly arrays.

src/core/types/artifacts.ts

catalog.tsMake store catalog config types Readonly and arrays readonly +69/-66

Make store catalog config types Readonly and arrays readonly

• Converts catalog config shapes (offers, subscriptions, products) to Readonly and changes array fields to readonly arrays, enforcing immutability for config inputs.

src/core/types/catalog.ts

commandDocs.tsMake command docs domain types Readonly +13/-13

Make command docs domain types Readonly

• Wraps command docs types in Readonly and marks collections as readonly arrays.

src/core/types/commandDocs.ts

config.tsMake config domain types Readonly +15/-14

Make config domain types Readonly

• Updates configuration domain types to be Readonly and converts nested arrays to readonly arrays where applicable.

src/core/types/config.ts

credentials.tsMake credentials domain types Readonly +26/-24

Make credentials domain types Readonly

• Converts credentials records (accounts, keys, signing assets) to Readonly and updates array fields to readonly arrays, requiring explicit cloning by mutators.

src/core/types/credentials.ts

dashboard.tsMake dashboard domain types Readonly +21/-21

Make dashboard domain types Readonly

• Wraps dashboard domain types in Readonly and updates array fields to readonly arrays.

src/core/types/dashboard.ts

doctor.tsMake doctor domain types Readonly +25/-24

Make doctor domain types Readonly

• Converts doctor domain types and their collection fields to readonly-friendly shapes.

src/core/types/doctor.ts

googlePlay.tsMake Google Play domain types Readonly +41/-41

Make Google Play domain types Readonly

• Wraps Google Play resource/config types in Readonly and converts collections to readonly arrays to enforce immutability across consumers.

src/core/types/googlePlay.ts

insights.tsMake insights domain types Readonly +12/-12

Make insights domain types Readonly

• Updates insights domain types to Readonly and readonly arrays for collections.

src/core/types/insights.ts

listing.tsMake listing domain types Readonly +9/-9

Make listing domain types Readonly

• Converts listing draft/brief types to Readonly and updates array fields to readonly arrays.

src/core/types/listing.ts

mcp.tsMake MCP domain types Readonly +9/-8

Make MCP domain types Readonly

• Wraps MCP-related types in Readonly and updates list fields to readonly arrays.

src/core/types/mcp.ts

migrate.tsMake migration domain types Readonly +40/-40

Make migration domain types Readonly

• Converts migration domain result/parsed shapes to Readonly and readonly arrays.

src/core/types/migrate.ts

mutable.tsIntroduce MutableDeep helper type +7/-0

Introduce MutableDeep helper type

• Adds a deep mutability utility type used to create mutable drafts from readonly domain values for controlled mutation points.

src/core/types/mutable.ts

plan.tsMake planning domain types Readonly +20/-20

Make planning domain types Readonly

• Updates plan types and collections to Readonly/readonly arrays to prevent mutation of planned structures.

src/core/types/plan.ts

playPricing.tsMake Play pricing domain types Readonly +9/-9

Make Play pricing domain types Readonly

• Wraps Play pricing types in Readonly and updates any collections to readonly arrays.

src/core/types/playPricing.ts

privacy.tsMake privacy domain types Readonly +11/-11

Make privacy domain types Readonly

• Converts privacy domain types to Readonly and collection fields to readonly arrays.

src/core/types/privacy.ts

providers.tsMake providers domain types Readonly +21/-21

Make providers domain types Readonly

• Updates provider interfaces/types to Readonly shapes and readonly arrays where applicable.

src/core/types/providers.ts

readiness.tsMake readiness domain types Readonly +61/-61

Make readiness domain types Readonly

• Converts readiness domain types to Readonly and updates nested arrays/records to readonly shapes.

src/core/types/readiness.ts

reconcile.tsMake reconcile action/report types Readonly +9/-6

Make reconcile action/report types Readonly

• Converts reconcile types (planned actions/reports) to Readonly, requiring callers to use mutable drafts for status mutation.

src/core/types/reconcile.ts

releaseTrain.tsMake release-train domain types Readonly +7/-7

Make release-train domain types Readonly

• Wraps release-train record types in Readonly and updates array fields to readonly arrays for immutability.

src/core/types/releaseTrain.ts

remote.tsMake remote domain types Readonly +14/-14

Make remote domain types Readonly

• Updates remote-related types to Readonly and readonly arrays where applicable.

src/core/types/remote.ts

snapshot.tsMake snapshot domain types Readonly and enforce readonly API surfaces +58/-54

Make snapshot domain types Readonly and enforce readonly API surfaces

• Converts snapshot record/capture types to Readonly, changes JsonValue containers to readonly, and marks snapshot client surfaces as read-only via Readonly-wrapped interfaces.

src/core/types/snapshot.ts

storeSurface.tsMake store-surface domain types Readonly +42/-42

Make store-surface domain types Readonly

• Updates store surface types and collections to Readonly/readonly arrays.

src/core/types/storeSurface.ts

vitals.tsMake vitals domain types Readonly +7/-7

Make vitals domain types Readonly

• Converts vitals domain types to Readonly and collection fields to readonly arrays.

src/core/types/vitals.ts

playClient.tsDeep-clone readonly boundary values before calling generated Google SDK +46/-24

Deep-clone readonly boundary values before calling generated Google SDK

• Adds a JSON-based deep-clone helper and uses MutableDeep in normalization to build mutable objects compatible with the generated androidpublisher client request types.

src/google/playClient.ts

playReporting.tsReadonly typing alignment for Play reporting helpers +2/-1

Readonly typing alignment for Play reporting helpers

• Adjusts Play reporting code to accept readonly domain collections.

src/google/playReporting.ts

local.tsUse readonly artifact index inputs and avoid in-place unshift +2/-3

Use readonly artifact index inputs and avoid in-place unshift

• Updates local storage provider to accept readonly artifact indexes and writes a new array rather than mutating the existing index in place.

src/providers/storage/local.ts

Tests (13) +26 / -19
appleSigning.test.tsUpdate tests for readonly signing/account types +2/-2

Update tests for readonly signing/account types

• Adjusts test typing/usages to match readonly domain shapes without changing assertions.

src/core/credentials/appleSigning.test.ts

gate.test.tsAdjust MCP gate tests for readonly types +1/-1

Adjust MCP gate tests for readonly types

• Updates test typing to accommodate readonly domain shapes.

src/core/mcp/gate.test.ts

tools.test.tsAdjust MCP tools tests for readonly types +2/-2

Adjust MCP tools tests for readonly types

• Updates MCP tools tests to satisfy readonly type constraints.

src/core/mcp/tools.test.ts

eas.test.tsUpdate EAS migration tests for readonly types +2/-2

Update EAS migration tests for readonly types

• Updates test fixtures and typings to match readonly domain definitions.

src/core/migrate/eas.test.ts

fastlane.test.tsUpdate Fastlane migration tests for readonly types +6/-3

Update Fastlane migration tests for readonly types

• Updates test code to match readonly migration types.

src/core/migrate/fastlane.test.ts

orchestrator.test.tsUpdate plan orchestrator tests for readonly plan types +1/-1

Update plan orchestrator tests for readonly plan types

• Adjusts test typing/fixtures for readonly domain plan shapes.

src/core/plan/orchestrator.test.ts

playSubscriptions.test.tsUpdate Play subscriptions planner tests for readonly types +3/-1

Update Play subscriptions planner tests for readonly types

• Adjusts tests for readonly subscription plan shapes.

src/core/plan/planners/playSubscriptions.test.ts

orchestrator.test.tsUpdate readiness orchestrator tests for readonly types +1/-1

Update readiness orchestrator tests for readonly types

• Adjusts test typing to align with readonly readiness domain types.

[Comment truncated to fit github's 65,536-char limit.]

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 132 files, which is 32 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.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23f6460d-29cd-4bde-94b6-c7b3a65ae65b

📥 Commits

Reviewing files that changed from the base of the PR and between 40998a7 and d0c226d.

⛔ Files ignored due to path filters (1)
  • src/apple/generated/specPatch.ts is excluded by !**/generated/**
📒 Files selected for processing (132)
  • src/apple/ascClient.ts
  • src/cli/commands/completion.ts
  • src/cli/commands/testflight.ts
  • src/cli/options.ts
  • src/core/adopt/capabilities.ts
  • src/core/adopt/certs.ts
  • src/core/adopt/configWriter.ts
  • src/core/adopt/products.ts
  • src/core/build/appleTargets.ts
  • src/core/build/artifactRetention.ts
  • src/core/build/buildDiagnostics.ts
  • src/core/build/buildHistoryCommand.ts
  • src/core/build/pipeline.ts
  • src/core/build/pipelineEnv.ts
  • src/core/build/pipelineSigning.ts
  • src/core/build/pipelineTypes.ts
  • src/core/build/pipelineVersion.ts
  • src/core/build/remotePipeline.ts
  • src/core/config/config.ts
  • src/core/config/env.ts
  • src/core/config/toolchain.ts
  • src/core/credentials/accounts.ts
  • src/core/credentials/appleSigning.test.ts
  • src/core/credentials/appleSigning.ts
  • src/core/credentials/capabilities.ts
  • src/core/credentials/pushKeyStore.ts
  • src/core/credentials/signingPreflight.ts
  • src/core/dashboard/render.ts
  • src/core/distribution/updateHistory.ts
  • src/core/docs/commandDocs/commandReference.ts
  • src/core/docs/commandDocs/common.ts
  • src/core/doctor/command.ts
  • src/core/insights/command.ts
  • src/core/listing/apply.ts
  • src/core/listing/generator.ts
  • src/core/mcp/gate.test.ts
  • src/core/mcp/tools.test.ts
  • src/core/migrate/command.ts
  • src/core/migrate/eas.test.ts
  • src/core/migrate/eas.ts
  • src/core/migrate/fastlane.test.ts
  • src/core/migrate/fastlane.ts
  • src/core/migrate/scaffold.ts
  • src/core/plan/orchestrator.test.ts
  • src/core/plan/orchestrator.ts
  • src/core/plan/planners/appStoreSurface.ts
  • src/core/plan/planners/euDistribution.ts
  • src/core/plan/planners/gameCenter.ts
  • src/core/plan/planners/playProducts.ts
  • src/core/plan/planners/playSubscriptions.test.ts
  • src/core/plan/planners/playSubscriptions.ts
  • src/core/plan/planners/wallet.ts
  • src/core/privacy/parse.ts
  • src/core/privacy/reconcile.ts
  • src/core/readiness/appScopes.ts
  • src/core/readiness/orchestrator.test.ts
  • src/core/readiness/probes/iapCodeReference.ts
  • src/core/readiness/probes/profileEntitlements.ts
  • src/core/release/statusCommand.test.ts
  • src/core/release/testflightFeedback.ts
  • src/core/release/version.ts
  • src/core/releaseTrain/orchestrator.ts
  • src/core/releaseTrain/record.ts
  • src/core/services/appleCredentialsClient.ts
  • src/core/services/artifactRetention.ts
  • src/core/services/localCredentialsStore.ts
  • src/core/services/logger.ts
  • src/core/services/progress.ts
  • src/core/services/sandbox.ts
  • src/core/services/ssh.ts
  • src/core/snapshot/orchestrator.test.ts
  • src/core/snapshot/orchestrator.ts
  • src/core/snapshot/snapshotCommand.ts
  • src/core/snapshot/sources/appleListing.ts
  • src/core/snapshot/sources/appleProducts.ts
  • src/core/snapshot/sources/appleSubscriptions.ts
  • src/core/snapshot/sources/playProducts.ts
  • src/core/snapshot/sources/playRestore.ts
  • src/core/snapshot/sources/playSubscriptions.ts
  • src/core/snapshot/store.ts
  • src/core/store/accessibility.ts
  • src/core/store/appEvents.ts
  • src/core/store/ascScreenshots.ts
  • src/core/store/ascSync.ts
  • src/core/store/availability.ts
  • src/core/store/gameCenter.ts
  • src/core/store/offers.test.ts
  • src/core/store/offers.ts
  • src/core/store/playProducts.ts
  • src/core/store/playSubscriptions.ts
  • src/core/store/playTracks.ts
  • src/core/store/reconcile.ts
  • src/core/store/reportsCommand.ts
  • src/core/store/syncJobs.ts
  • src/core/store/syncRun.ts
  • src/core/store/team.ts
  • src/core/store/walletIds.ts
  • src/core/terminal/completion.ts
  • src/core/terminal/halfblock.ts
  • src/core/terminal/wizardCommand.test.ts
  • src/core/terminal/wizardCommand.ts
  • src/core/types/adopt.ts
  • src/core/types/agents.ts
  • src/core/types/appleCatalog.ts
  • src/core/types/artifacts.ts
  • src/core/types/catalog.ts
  • src/core/types/commandDocs.ts
  • src/core/types/config.ts
  • src/core/types/credentials.ts
  • src/core/types/dashboard.ts
  • src/core/types/doctor.ts
  • src/core/types/googlePlay.ts
  • src/core/types/insights.ts
  • src/core/types/listing.ts
  • src/core/types/mcp.ts
  • src/core/types/migrate.ts
  • src/core/types/mutable.ts
  • src/core/types/plan.ts
  • src/core/types/playPricing.ts
  • src/core/types/privacy.ts
  • src/core/types/providers.ts
  • src/core/types/readiness.ts
  • src/core/types/reconcile.ts
  • src/core/types/releaseTrain.ts
  • src/core/types/remote.ts
  • src/core/types/snapshot.ts
  • src/core/types/storeSurface.ts
  • src/core/types/vitals.ts
  • src/google/playClient.ts
  • src/google/playReporting.ts
  • src/providers/credentials/local.test.ts
  • src/providers/storage/local.ts

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


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

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📜 Skill insights (0)

Grey Divider


Action required

1. BuildEngine not in types.ts 📘 Rule violation ⌂ Architecture
Description
Provider interface/types like CredentialsProvider and BuildEngine are (re)defined in
src/core/types/providers.ts rather than being defined in src/core/types.ts as required, which
undermines the single canonical import surface for core provider shapes.
Code

src/core/types/providers.ts[R35-38]

+export type CredentialsProvider = Readonly<{
  readonly name: string;
  resolveBuildCredentials(
    buildContext: ResolvedBuildContext,
Evidence
The checklist requires provider interfaces/types to be defined in src/core/types.ts. The diff
shows these provider shapes being defined/updated in src/core/types/providers.ts (e.g., `export
type CredentialsProvider and export type BuildEngine`).

Rule 1028638: Domain shapes and provider interfaces must be defined in src/core/types.ts
Rule 1015968: Centralize core domain types and provider interfaces in src/core/types.ts
src/core/types/providers.ts[35-61]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Core provider shapes (`CredentialsProvider`, `BuildEngine`, etc.) are defined in `src/core/types/providers.ts`, but compliance requires these domain/provider interface definitions to live in `src/core/types.ts`.

## Issue Context
This PR refactors types to readonly, but it also leaves the provider interface/type definitions outside the mandated `src/core/types.ts` location.

## Fix Focus Areas
- src/core/types/providers.ts[35-61]
- src/core/types.ts[1-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. BundleIdResource in core types 📘 Rule violation ⌂ Architecture
Description
App Store Connect *Resource types are defined/maintained in src/core/types/appleCatalog.ts
instead of src/apple/ascClient.ts, which violates the required placement for ASC resource/query
shapes.
Code

src/core/types/appleCatalog.ts[R7-10]

/** A registered Bundle ID resource (an App ID in the Developer portal). */
-export type BundleIdResource = {
+export type BundleIdResource = Readonly<{
  id: string;
  identifier: string;
Evidence
The checklist requires ASC *Resource/*Query types to be defined in src/apple/ascClient.ts. The
diff shows ASC resource types like BundleIdResource being defined/modified in
src/core/types/appleCatalog.ts.

Rule 1028639: App Store Connect Resource/Query types must live in src/apple/ascClient.ts
src/core/types/appleCatalog.ts[7-19]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
ASC `*Resource` types (e.g., `BundleIdResource`, `CertificateResource`) are located in `src/core/types/appleCatalog.ts`, but compliance requires ASC Resource/Query types to live in `src/apple/ascClient.ts`.

## Issue Context
This PR updates these types to be `Readonly`, but it keeps them in a core types module rather than the ASC client module.

## Fix Focus Areas
- src/core/types/appleCatalog.ts[7-33]
- src/apple/ascClient.ts[1-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 48 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment on lines +35 to 38
export type CredentialsProvider = Readonly<{
readonly name: string;
resolveBuildCredentials(
buildContext: ResolvedBuildContext,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. buildengine not in types.ts 📘 Rule violation ⌂ Architecture

Provider interface/types like CredentialsProvider and BuildEngine are (re)defined in
src/core/types/providers.ts rather than being defined in src/core/types.ts as required, which
undermines the single canonical import surface for core provider shapes.
Agent Prompt
## Issue description
Core provider shapes (`CredentialsProvider`, `BuildEngine`, etc.) are defined in `src/core/types/providers.ts`, but compliance requires these domain/provider interface definitions to live in `src/core/types.ts`.

## Issue Context
This PR refactors types to readonly, but it also leaves the provider interface/type definitions outside the mandated `src/core/types.ts` location.

## Fix Focus Areas
- src/core/types/providers.ts[35-61]
- src/core/types.ts[1-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 7 to 10
/** A registered Bundle ID resource (an App ID in the Developer portal). */
export type BundleIdResource = {
export type BundleIdResource = Readonly<{
id: string;
identifier: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. bundleidresource in core types 📘 Rule violation ⌂ Architecture

App Store Connect *Resource types are defined/maintained in src/core/types/appleCatalog.ts
instead of src/apple/ascClient.ts, which violates the required placement for ASC resource/query
shapes.
Agent Prompt
## Issue description
ASC `*Resource` types (e.g., `BundleIdResource`, `CertificateResource`) are located in `src/core/types/appleCatalog.ts`, but compliance requires ASC Resource/Query types to live in `src/apple/ascClient.ts`.

## Issue Context
This PR updates these types to be `Readonly`, but it keeps them in a core types module rather than the ASC client module.

## Fix Focus Areas
- src/core/types/appleCatalog.ts[7-33]
- src/apple/ascClient.ts[1-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant