Add resilient usage analytics, OOBE gateway flows, clipboard semantic ranking, purchase recovery, style learning, and managed current-information search.
5.8 KiB
Account and managed gateway verification
This checklist validates the optional OSG account path without changing the existing local or BYOK defaults. Never record tokens, Apple identifiers, audio, prompts, transcripts, or model output while running these checks.
Automated gate
./Scripts/run-tests.sh validate
./Scripts/run-tests.sh pr
swiftlint lint --quiet --strict
xcodebuild \
-project OSGKeyboard.xcodeproj \
-scheme OSGKeyboardUITests \
-destination 'platform=iOS Simulator,name=iPhone 17' \
-only-testing:OSGKeyboardUITests/AccountCenterUITests \
test
xcodebuild \
-project OSGKeyboard.xcodeproj \
-scheme OSGKeyboard \
-destination 'generic/platform=iOS Simulator' \
-configuration Release \
-onlyUsePackageVersionsFromResolvedFile \
CODE_SIGNING_ALLOWED=NO \
build
The account and managed gateway tests must remain hermetic. They use injected Apple integrity adapters, URL loading stubs, and WebSocket fakes rather than production credentials.
Physical-device prerequisites
- A development build signed for
com.osgkeyboard.ios. - Sign in with Apple, App Attest, DeviceCheck, Associated Domains, and both Keychain groups enabled in the provisioning profile.
https://osglab.com/.well-known/apple-app-site-associationreturns HTTP 200 without a redirect and includesX329MZU23S.com.osgkeyboard.iosfor/i/*.- The production account service is ready at
https://account.osglab.com. - The production service temporarily enables
ALLOW_DEVELOPMENT_APP_ATTEST=truefor the test window; disable it again after physical-device testing. - OSGKeyboard is installed and enabled with Full Access for managed requests.
- The test account has enough non-production credits for the requested checks.
Identity and account
- Sign in with Apple and verify that nickname, balance, and referral state load after a cold launch.
- Confirm the raw nonce is never persisted and an App Attest assertion is accepted. Repeat after an access-token expiry to exercise one refresh.
- Open
https://osglab.com/i/{test-code}while signed out. Sign in, then verify the pending code is redeemed exactly once. - Force-quit and reopen the app. Verify session recovery without another Apple prompt and confirm the keyboard extension cannot read the account session.
- Sign out and verify account tokens plus shared gateway grants are removed.
- Sign in again, choose Delete Account, complete Apple reauthentication, and verify local and BYOK features still work afterward.
For destructive verification, use a disposable Apple sandbox identity:
- Set a nickname, generate an invitation code, and select Use Credits.
- Delete the account after both confirmations and fresh Apple authorization.
- Confirm the app returns to signed-out/BYOK state and no account, grant, profile, or purchase state remains visible.
- Confirm old access and refresh tokens receive
401; an Apple revoke outage must not restore the locally deleted account. - Sign in again and confirm a new local App Attest key state is registered.
Only pseudonymous immutable ledger, StoreKit audit, and time-limited anti-abuse records remain where required for replay and abuse prevention.
Managed DeepSeek
- Select Use Credits for the first time. Verify the managed-cloud data disclosure appears, Cancel leaves BYOK selected, and Agree enables credits. Switch away and back again to confirm the disclosure is not repeated.
- Verify the runtime uses managed Volcengine ASR and managed polishing together.
- Run one polish request and one AI request. Verify actionable behavior for insufficient balance, expired grant, timeout, and cancellation.
- In the server ledger, verify one reservation and one settlement per request. Retrying the same transport request must not create a second charge.
Managed Volcengine ASR
- Record approximately ten seconds of Mandarin PCM16LE at 16 kHz.
- Verify partial and final results, then run translate-and-polish.
- Cancel one recording mid-stream and verify the WebSocket closes without a stuck reservation.
- Verify session-open fallback, idle timeout, empty result, insufficient balance, and concurrency-limit behavior.
- Confirm the ledger settles successful sessions and releases failed or cancelled reservations.
Managed ASR currently does not send hotwords. Treat this as an explicit product difference until the server request schema supports them.
Regression gate
- Signed-out use remains valid.
- Local ASR never requires an account.
- Existing BYOK LLM and ASR credentials still use their direct providers.
- iCloud settings sync never contains account or gateway tokens.
- Flow, keyboard typing, and keyboard-extension memory-budget tests pass.
StoreKit credits
The existing ByRockyACoffee product remains a voluntary consumable and never
grants credits. Configure 500tks for 500 credits at USD 0.99, 1500tks for
1,500 credits at USD 1.99 / CNY 18, and 3000tks for 3,000 credits at
USD 2.99 / CNY 28.
- Use a Sandbox Apple account and sign in to the same OSG account before purchasing.
- Confirm the purchase supplies the OSG account UUID as
appAccountToken. - Buy each product and verify the server grants exactly 500, 1,500, or 3,000
credits and appends one
STOREKIT_PURCHASEledger entry before the app finishes the transaction. - Submit the same signed transaction again and verify the response is marked as replayed without changing the balance.
- Interrupt the network after App Store success but before server acknowledgement. Relaunch and verify the unfinished transaction reconciles once.
- Sign in to another OSG account and verify the first account's transaction is rejected.
- Confirm there is no Restore Purchases action for credit packs and that the voluntary tip still changes only the local support count.