Skip to content

Reconcile StoreKit entitlements and add deterministic integration tests#3

Merged
lynnswap merged 17 commits into
mainfrom
codex/storekit-integration-tests
Jul 17, 2026
Merged

Reconcile StoreKit entitlements and add deterministic integration tests#3
lynnswap merged 17 commits into
mainfrom
codex/storekit-integration-tests

Conversation

@lynnswap

@lynnswap lynnswap commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Purpose

Make StoreKit transaction processing and entitlement observation durable across startup, subscription changes, upgrades, expiration, restoration, cancellation, and shutdown.

Changes

  • Rename the observable public store from Store to TransactionStore and preserve unresolved versus resolved-empty entitlement state.
  • Reconcile every verified unfinished transaction, including consumables, before querying current entitlements, while preserving startup retry boundaries.
  • Preserve and deduplicate unverified unfinished-transaction diagnostics across reconciliation scans.
  • Monitor subscription status updates, exclude superseded upgrade transactions from active access, and report unverified reconciliation deliveries instead of dropping them.
  • Make coalesced processing, refresh, and restore operations cancellation-safe, and report abandoned failures only after every attached public caller has detached.
  • Order startup readiness failures and successful refreshes by their physical refresh sequence, including equal-content successes.
  • Expand public transaction snapshots and lifecycle documentation.
  • Add an app-hosted StoreKit test application with deterministic scenarios for purchases, upgrades, downgrades, renewal, expiration, refunds, Ask to Buy, unfinished transactions, and restore behavior.
  • Run package, simulator, integration, release, DocC, formatting, pinning, and external-consumer checks in CI. The iOS job is capped at 10 minutes and selects the iOS 26.2 runtime compatible with the StoreKit test configuration.

Testing

  • App-hosted StoreKit integration tests on iOS 18.6: 19 passed
  • Swift package tests on macOS and iOS 18.6: 78 passed
  • macOS release build
  • Generic iOS Simulator build
  • DocC archive build
  • External consumer resolve and build
  • Strict swift-format lint
  • GitHub Actions pin verification and actionlint
  • Branch-wide Codex review against pinned main: no actionable findings

lynnswap added 4 commits July 17, 2026 01:36
Make TransactionStore the observable process owner, reconcile unfinished revisions to a fixed point, and refresh on subscription status changes. Preserve per-element verification failures, single report authority, cancellation identity, and drain guarantees across direct and background operations.

BREAKING CHANGE: Store has been renamed to TransactionStore without a compatibility alias.
Exercise direct and external purchases, launch reconciliation, upgrade and downgrade transitions, cancellation through expiration, renewal, refunds, restore retry, and Ask to Buy using event-driven StoreKitTest assertions.
Pin the StoreKit lane to Xcode 26.5 and its iOS 26.4 runtime, disable parallel execution, and include the app-hosted test sources in swift-format linting.
Document TransactionStore ownership, unresolved and failed startup states, upgrade-safe entitlement checks, revocation handling, callback reentrancy, promoted purchases, restore cancellation, and stable entitlement ordering.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4866d7cb79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/StoreTransactionKit/Entitlements/CurrentEntitlementReconciler.swift Outdated
Comment thread Sources/StoreTransactionKit/Entitlements/CurrentEntitlementReconciler.swift Outdated
lynnswap added 9 commits July 17, 2026 09:40
Process verified unfinished deliveries independently of entitlement membership or product type. Report stable unverified deliveries once, keep failed revisions retryable, and document the readiness contract.
Propagate transaction-processing ownership through entitlement refreshes so background, abandoned, and restore paths do not report the same physical failure twice. Public callers continue to receive the original underlying error.
Retain failed transaction receipts for the complete physical startup attempt so StoreKit launch replay and unfinished reconciliation cannot execute the same revision twice. Caller cancellation no longer advances readiness gates before reconciliation terminates.
Report unverified unfinished and current-entitlement diagnostics when durable reconciliation terminates with a handler failure, without repeating diagnostics from nonterminal fixed-point iterations.

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4a64f9e87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/StoreTransactionKit/Entitlements/CurrentEntitlementReconciler.swift Outdated

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: dd39749e5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap
lynnswap merged commit ece8182 into main Jul 17, 2026
2 checks passed
@lynnswap
lynnswap deleted the codex/storekit-integration-tests branch July 17, 2026 06:05
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