Use develop for daily development. Keep agent review and the documented
verification checks in the daily workflow. main tracks the released baseline.
Before shipping, open a pull request from develop into main, share the release
diff with the owner, and record the exact candidate commit. Wait for the owner's
review and approval before merging; do not create a separate candidate branch
by default. After publication, merge only the reviewed, released candidate.
If develop has advanced, avoid including later work and consult the owner when
needed. Preserve commit ancestry so the next release comparison starts from the
previous released candidate.
Incomes is a budget planner for looking ahead at future balances and deciding how to use your money. Planned income and expenses form the basis of that outlook; recurring items, balance charts, and month/year views help users keep their plan current across iPhone, Apple Watch, and widgets.
The app uses SwiftUI and stores data with SwiftData in a shared app group container, optionally syncs through CloudKit, and layers on StoreKit 2 subscriptions, Google Mobile Ads, and App Intents powered by Apple Foundation Models.
- Incomes – the iOS app that drives the end-to-end experience with SwiftUI views, SwiftData, and on-device services such as notifications, ads, and App Intents.
- Watch – a watchOS companion that mirrors upcoming payments, settings, and read-only diagnostics while staying in sync with the phone via WatchConnectivity snapshots.
- Widgets – a WidgetKit bundle that surfaces balances, upcoming transactions, and monthly breakdowns on the Home Screen and StandBy.
- IncomesLibrary – the shared domain layer containing the SwiftData models, balance calculator, notification planner, and sync payloads used by every target.
- Use Input Assistance to interpret typed or pasted text with on-device AI and prefill the ordinary editable form; creating the Item remains explicit. Copy or share one saved Item as readable text for use elsewhere. See Item input and content sharing for the retained journeys and retirement of the 6.2 Markdown template.
- Capture receipts through the photo library or camera, then run on-device VisionKit text recognition to assemble a transcript.
- Use Apple Foundation Models to infer the date, amounts, and category that pre-populate the item form or App Intent output, respecting the user’s locale.
- Create and edit items with repeat tracking, categorisation, and automatic tag management to keep yearly and monthly views tidy.
- Seed preview or debug databases with realistic sample data to explore the UI without real transactions.
- Drill into periods or categories using search targets and tag summaries backed by SwiftData queries and chart-ready aggregates.
- Prepare a monthly summary when opening a month using the on-device model behind Apple Intelligence. Calculated fallback text is identified separately, and generated prose never changes saved amounts or balances.
- Generative features require iOS 26 or later, a compatible device, and Apple Intelligence ready in a supported language. Their App Intent adapters remain undiscoverable while the system experience is qualified.
- Open Settings > Advanced > Debug to inspect local logs and saved data without changing financial records or Premium access.
- Open the log console from Debug on the startup-error screen when the database cannot be opened. This entry does not require a model container.
- Export logs explicitly after reviewing them. Sample insertion, TipKit test controls, and other development tools are available only in DEBUG builds.
- See Diagnostic Boundaries for available operations and release disclosure expectations.
- Configure notification rules, register reminders, and deliver badge-aware updates with the notification service and planner.
- Trigger test alerts and refresh badge counts to keep multiple devices in sync.
- Share data through a single SwiftData store located in the app group container, with legacy SQLite migration for existing users.
- Sync recent transactions to watchOS by replying to WatchConnectivity requests with trimmed JSON payloads and recalculating balances after import.
- Open the StoreKit 2 paywall to manage premium subscriptions, automatically toggle iCloud sync, and start Google Mobile Ads placements.
- Fetch shared app configuration from MHAppConfig at startup and foreground entry, and check update requirements before phone data mutations.
- Offer App Intents for listing, opening, creating, and renaming ledgers, checking saved balances, and previewing an import. Paid mutations use the same Monthly Plan entitlement as the app.
- Scope item creation, queries, display, and yearly duplication to an optional ledger; omitting it preserves the default book used by existing Shortcuts.
- Keep backup execution, ownership recovery, and AI adapters undiscoverable while their system experience is qualified; see the exposure follow-up.
- SwiftData + App Group – the host app owns writes and migration in the
store rooted at
group.com.muhiro12.Incomes; widgets open it read-only. Watch uses an isolated in-memory store populated by phone snapshots. UpdateAppGroup.idwhen using your own bundle identifiers. - Database migration –
DatabaseMigratormoves legacy SQLite files into the shared container on first launch so long-time users keep their history. - WatchConnectivity bridge –
PhoneWatchBridgeanswers watch requests with typedWatchSyncReplypayloads, whilePhoneSyncClientmanages activation and message replies on watchOS. - Development data – normal DEBUG builds use a separate persistent
Incomes-Development.sqlitestore without iCloud sync. The first creation seeds the standard sample profile; later launches preserve edits and empty states. See Sample Data Profiles for disabling seeding and testing an empty store. Release keeps its existing store, migration, and sync behavior. - Preview infrastructure –
IncomesSampleDataprovisions an in-memory store, a named sample-data profile, and mock services so SwiftUI previews remain functional. See Sample Data Profiles. - Subscription and iCloud – Premium consumers observe resolved access in the current session. The saved iCloud choice survives a lapse; production startup enables sync only when both that choice and last resolved access are on. Settings identifies the current container's configuration, which remains unchanged until the next launch. See Subscription and iCloud for the StoreKit verification and live-transition boundaries.
-
Product and design principles explain the budget-planning purpose and durable model tradeoffs (日本語).
-
IncomesLibraryis the app's behavioral source of truth. It owns the product rules that should remain correct regardless of whether the user reaches them through iOS, iPadOS, watchOS, widgets, App Intents, or Shortcuts. -
Thin targets in this repository are responsibility-thin, not line-count-thin.
Incomes,Watch,Widgets, and App Intents may still own SwiftUI shells, lifecycle wiring, routing, and framework adapters, but reusable finance rules and shared sync contracts belong inIncomesLibrary. -
IncomesLibraryowns the shared SwiftData model, mutation/query services, widget snapshot builders, and cross-target sync types such asWatchSyncReply. -
Incomes,Watch,Widgets, and App Intents consume those shared APIs and remain the place for Apple-specific integration work such as notifications, WatchConnectivity, WidgetKit, StoreKit, ads, and Foundation Models. -
When
IncomesLibraryis correctly tested, destructive product-behavior regressions should be caught there; target-local failures should usually be limited to presentation, routing, dependency wiring, or platform delivery. -
Automated unit tests stay in
IncomesLibrary/Tests. This repository does not add separate unit test targets forIncomes,Watch, orWidgets; those adapters are verified through builds plus shared-library tests. -
Start detailed architecture reading from ARCHITECTURE_GUIDE.md, shared-service-design.md, incomes-current-overview.md, and incomes-architecture-conformance-audit.md.
Incomesintentionally adopts the fullMHPlatformumbrella because the app uses package-owned runtime surfaces plus route, mutation, and review shells.IncomesLibraryintentionally adoptsMHPlatformCoreas the shared-library umbrella for core-safe platform helpers.Watchintentionally stays on the narrowerMHPreferencesandMHPreferencesUIproducts.Widgetsintentionally stay off direct MHPlatform package adoption.- This repository intentionally tracks MHPlatform with the 1.x semver range
1.20.0..<2.0.0. - App, watch, and widget UI use only the
MHDesignproduct from MHUI 2.4 or later; theMHUIproduct is not linked. - The app opts into MHPlatform's consent-managed ads and exposes privacy
options in Settings when required by the SDK. Startup cleanup preserves the
SDK's current consent keys. AdMob Privacy & messaging configuration remains
publisher-owned; local verification does not confirm live account setup.
Debug builds accept
INCOMES_ADS_CONSENT_DEBUG_GEOGRAPHY=eea,regulatedUSState, orotherfor regional consent checks on test devices. Distribution builds ignore this environment variable. Keep the Incomes app identifier when verifying its published consent message; test ad units do not replace application-specific message configuration. - The standard update controller uses
MHRemoteConfigthrough the existing umbrellas to fetch and validate the shared MHAppConfig document. Update policy owns onlyfeatures.remoteUpdate; no publisher renewal job is needed. - Ledger migration retains its existing numeric-string comparison through
MHAppVersionComparison; adopting typed remote-update versions does not change migration ordering.
- Xcode 27 or later to read the JSON project configuration. The current format qualification uses Xcode 27.2 RC (27B48). Match local release verification to the actual toolchain used for the release candidate; project-format compatibility alone does not qualify a toolchain for release.
- The app and widgets deploy to iOS 18 or later, and the watchOS companion deploys to watchOS 11 or later.
- An Apple Developer account configured for App Groups, iCloud, StoreKit 2, notifications, and ads.
- A device or simulator running iOS 26 or later with Foundation Models support for on-device inference features.
Follow these steps to run a local build:
- Clone the repository, check out
develop, and open the project directory. Release tags preserve the corresponding published baselines. - Update bundle identifiers and the app group constant to match your provisioning profile if you are not using the production identifiers.
- If you are shipping a fork with your own identifiers, update
IncomesLibrary/Sources/Persistence/AppGroup.swift,Incomes/Configurations/Incomes.entitlements,Watch/Configurations/Watch.entitlements,Widgets/Configurations/Widgets.entitlements, andIncomes/Sources/Platform/IncomesMonetizationConfiguration.swift. - Open
Incomes.xcodeprojin Xcode, select the Incomes scheme, and run on an iOS 18 or later simulator or device. Use an iOS 26 or later destination when testing Foundation Models features. Enable the Watch and Widgets schemes if you want to test the companion experiences.
The app fetches the shared
MHAppConfig document
through its HTTPS Raw URL in IncomesRemoteUpdateConfiguration. The common
envelope validates the app identity and selects features.remoteUpdate.
The policy preserves the existing minimum version of 5.0, with an empty
scheduledRequirements list until a future release decision is made.
An unchanged static policy requires no publisher expiry, scheduled workflow,
or periodic commit. Edit the update feature and increase its revision only when
the release decision changes. Keep the baseline in requirement when adding
timed plans to scheduledRequirements. The controller applies the highest
currently active minimum and reevaluates activation and end times before writes.
Ending a plan leaves other active requirements in force. Full cancellation needs
explicit requirement: null and an empty plan list, with a higher revision.
The standard controller uses the Incomes Store ID and the package's default publication reference without a fixed country code. It automatically isolates update-section validation from unrelated features in the shared document; an invalid update section cannot renew evidence or authorize writes. No app-owned plan selector, feature recovery registry, or older-reader fallback is needed.
prepare() runs at startup and foreground entry. Only a validated network fetch
renews policy evidence, with up to 30 days of offline reuse. App Store publication
evidence has its separate 24-hour lifetime. Storage is source-scoped in
Application Support. By default, missing, incompatible, or expired evidence
blocks protected writes, and invalid setup never falls back to the old endpoint.
Settings includes a dedicated Offline Editing screen explaining its benefit and
data risks. Explicit confirmation enables a device-local exception for unavailable
update evidence. Confirmed required updates still block while the evidence remains
valid. Unreceived or expired requirements can be bypassed; even one write may cause
data problems that a later update cannot repair. Developer-provided data repair
or recovery is not offered for this exception. The setting defaults to off and
does not disable refreshes or change iCloud sync. It is read again before each
mutation, including headless App Intents. The controller
restores retained evidence on the first operation check, so a background App
Intent can use still-valid permission offline without an app-owned preparation
flag. Read-only evaluations expose one decision, reason, revision, active minimum,
and evidence freshness; logs use the same diagnostic instant as the decision.
Controller instances and processes coordinate revision-checked shared evidence
through the configured store. Previews and isolated environments disable fetching
and update enforcement.
Phone UI and App Intents check immediately before user-requested item, ledger, and tag mutations, balance recalculation, import, yearly duplication, and data maintenance. Rejection skips the mutation and success effects. Browsing, export, retry, and the Store route remain available. Startup data migration, automatic CloudKit delivery, and the Watch's local mirror are outside this user-operation gate. Existing binaries are not retroactively protected.
The old .config.json remains compatible with already-distributed app versions.
It is not fetched by this integration and must not be replaced with the new wire
format. Forks must configure their own endpoint, Store ID, and app identity.
Use the package's configuration and update contract for deployment, plan changes, postponement, and explicit cancellation. This integration targets 1.20 or later for the first shared-configuration app release.
See Xcode project format for configuration compatibility, conversion qualification, and rollback.
Use Xcode and the active Xcode-native integration for Apple build, test, run, Simulator, runtime logs, Preview rendering, screenshots, and live UI inspection. Xcode Cloud owns formal CI builds, tests, and archives.
Before changing Xcode selection, record the original scheme and destination, switch only to discovered values, and end sessions or runs started solely for verification. Restore the original scheme first, rediscover its destinations, restore the original destination, and confirm the selection. Report failed restoration.
The remaining helper scripts in ci_scripts/ are intentionally small. Direct
entrypoints live in ci_scripts/tasks/, shared shell helpers live in
ci_scripts/lib/, and ci_scripts/ci_post_clone.sh is reserved for external
post-clone CI setup.
bash ci_scripts/tasks/check_environment.sh --profile <swiftlint|rules>diagnoses missing local prerequisites before running the retained scripts.bash ci_scripts/tasks/format_swift.shis the explicit SwiftLint autofix step to run after Swift edits.bash ci_scripts/tasks/lint_swift.shruns the project-managed SwiftLint binary without requiring a separately installedswiftlintcommand.bash ci_scripts/tasks/check_repository_rules.shruns SwiftLint plus the repository-specific static architecture checks that are not naturally covered by the Xcode-native integration.- The push verification pilot records actual verification evidence and compares it with the exact outgoing branch updates. Its hook is local setup, and required checks remain explicit.
- Release UI smoke auditing uses live Simulator evidence. Use the release UI smoke audit guide when a release or UI-sensitive change needs live Simulator evidence.
SwiftLint is resolved from the SimplyDanny/SwiftLintPlugins package declared
in Incomes.xcodeproj. The repository scripts do not require a separately
installed swiftlint binary on your PATH.
Before running retained script checks, diagnose the local prerequisites:
bash ci_scripts/tasks/check_environment.sh --profile rulesAfter Swift edits, run the explicit autofix step:
bash ci_scripts/tasks/format_swift.shThen run the retained repository rule checks:
bash ci_scripts/tasks/check_repository_rules.shIf you prefer to run the SwiftLint steps directly:
bash ci_scripts/tasks/format_swift.sh
bash ci_scripts/tasks/lint_swift.shChoose verification by the changed boundary and resolve actions from the active integration's tool inventory:
- Shared-library logic, model, or test changes: run the
IncomesLibraryscheme's tests on a discovered iOS Simulator. - Public library APIs,
*Operations, shared sync or wire contracts, SwiftData schema, or adapter-facing contracts: also build theIncomesconsumer scheme. - App compile checks: build
Incomeson a discovered iOS Simulator. - Widgets changes: build
Widgetson a discovered iOS Simulator. - Watch changes: build
Watchon a discovered watchOS Simulator. Product linkage changes also need anIncomesembedding build; paired-device delivery remains separate runtime evidence. - Runtime or UI-sensitive changes: add a targeted run and runtime-log review, with Preview, live UI, or screenshot evidence appropriate to the change.
Runtime and UI checks require signed App Group entitlements at launch. Do not
disable signing for these checks; CODE_SIGNING_ALLOWED=NO is limited to
compile-only builds. Library tests, surface builds, and runtime/UI evidence
prove different boundaries.
Follow the repository SwiftLint configuration and existing Swift source style. Markdown follows the markdownlint rules.
Helper scripts may write disposable cache data under .build/ci/shared/.
The rules receipt accepts the complete bash ci_scripts/tasks/check_repository_rules.sh
execution, including a source-bound SwiftLint record with its actual artifact,
version, binary hash, configuration, and full tracked Swift file scope. SwiftLint
is selected only from the configured project's registered package artifacts;
other repositories' global DerivedData are not fallback inputs. An explicit
CI_SWIFTLINT_BIN must match an artifact in those configured package roots.
Missing resolution or tool mismatches are incomplete verification, not a reason
to install another linter. Boundary searches likewise distinguish no matches
from failed or unavailable searches.
If package tests report a macOS sysroot while targeting iOS Simulator, inspect
the actual link command and the build service's SDKROOT environment first.
A host macOS SDK can reach Clang even when Swift's -sdk points to the correct
Simulator SDK. This was reproduced with Xcode 27.2; it does not require changing
the package's supported platforms or suppressing the warning. See the
Swift compiler discussion.
When the native integration retains that environment and cannot override it,
use the selected Xcode's executable directly with SDKROOT removed for this
invocation. Replace the destination placeholder with the app's discovered
Simulator UUID:
env -u SDKROOT "$(xcode-select -p)/usr/bin/xcodebuild" \
-project Incomes.xcodeproj -scheme IncomesLibrary \
-destination 'platform=iOS Simulator,id=<discovered-simulator-uuid>' testThis is a scoped fallback, not a change to the running native build service. Verify that the affected test bundles actually relink and inspect their diagnostics; a cached build alone does not demonstrate that the warning is gone.
With Xcode 27.2, both generated library test bundles report
Metadata extraction skipped, no AppIntents.framework dependency found.
IncomesLibrary, its tests, and their current dependencies contain no App Intents;
these diagnostics do not indicate missing metadata in the app's Shortcuts.
For the library-only command-line fallback, skip the unnecessary extraction task
with LM_SKIP_METADATA_EXTRACTION=YES. Swift Build checks this setting before
creating the metadata tasks.
Keep these build products separate from normal app builds:
env -u SDKROOT "$(xcode-select -p)/usr/bin/xcodebuild" \
-project Incomes.xcodeproj -scheme IncomesLibrary \
-destination 'platform=iOS Simulator,id=<discovered-simulator-uuid>' \
-derivedDataPath /tmp/incomes-library-tests-no-appintents \
LM_SKIP_METADATA_EXTRACTION=YES testThis invocation-wide override is limited to the library scheme. Do not apply it to app, widget, watch, or archive builds, which need App Intents metadata. Reassess it if the library or its dependencies start defining App Intents. The native integration tools cannot currently override settings for these generated SwiftPM test targets, so its unmodified test builds may still emit the warnings. Do not add an unused AppIntents dependency or suppress all extractor warnings to make those builds quiet.
Incomes 6.x uses Apogee release tools in a separate macOS SwiftPM package. The package pins Apogee independently of the app and supports local metadata validation, read-only release status, metadata, and TestFlight feedback inspection, and reviewed version, metadata, screenshot, build-attachment, and submission operations.
Xcode Cloud continues to own formal builds, tests, archives, and binary upload.
The current workflow starts from develop. Before each candidate, confirm its
settings and the source commit, action results, uploaded build, and actual Xcode
version in the build record. Match that toolchain locally. Follow the
release procedure to connect the
published App Store build, release tag, GitHub Release, and owner-reviewed
develop-to-main PR without including later development.
Apogee creates App Store versions and changes publication policy only through
explicit, reviewed operations, and never builds or uploads binaries.