Skip to content

feat: build native offline gameplay and simulator qualification - #57

Merged
HemSoft merged 13 commits into
mainfrom
feat/ios-offline-foundation
Oct 1, 2026
Merged

HemSoft merged 13 commits into
mainfrom
feat/ios-offline-foundation

Conversation

@HemSoft

@HemSoft HemSoft commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add an offline native iPhone/iPad interface around the shared rules, with acknowledged saves, resume, local history, recovery, native navigation and development assets. Online web/Electron adapters keep their backend authority.

This is partial repository implementation for #40, #41, #42, #44, #45, #46 and #48. Their full release-acceptance work remains open.

Acceptance Criteria

  • Remove mobile's required Convex path without changing online clients.
  • Add schema/rules validation, staged exact-byte retries, active resume, local history/top tens and explicitly confirmed reset.
  • Use a dedicated native SQLite database, with atomic document commits and visible corruption failures. Preserve AsyncStorage only for legacy names/theme import and the web development adapter.
  • Implement native setup, gameplay, results, history and Help, with scalable system text, semantic iOS colors, safe areas and native navigation/actions.
  • Add original editable icon geometry, light/dark/tinted exports, launch art, provenance and full PNG checks.
  • Add an unsigned hosted macOS Release build and simulator interaction matrix without credentials or paid device services.
  • Qualify the actual native build and generated CocoaPods lock, inspect current-head captures and address failures.

Definition of Done

  • Local types/lint, persistence regressions, JavaScript exports, client journeys, quality measurement and dependency audit pass.
  • Tooling tests and workflow lint pass.
  • Generated CocoaPods lock retrieved from the successful native compile, inspected and committed.
  • Fresh hosted checks, including deployment-mode lock consistency and native interaction evidence.
  • Current-head native screenshots/recording attached and public rendering inspected.
  • Required connected Codex review, with actionable threads resolved.

Validation

Current head 86011d88d87b264e7b3b09011527842321de1c2b, rebased on main ba8d370. Native qualification passed, including all eight solo/three-AI games, both largest-text scenarios, damaged JSON/database preservation and explicit reset/relaunch. Current-head connected Codex review has no findings. All 11 embedded screenshots decode at their original dimensions. The inline original recording loads, seeks and displays native gameplay. All 12 public attachments match original size and SHA256. Final source/check/thread/protection gates are verified before the guarded merge.

Phone six needed one fresh failed-group run after its first cold Resume Game tap had no navigation effect. The original saved document remained byte-identical. The failing attempt is retained; no state-changing tap was replayed, source changed or check weakened. The passing retry is identified by artifact ID11135623534 and runAttempt2, because GitHub exposes duplicate same-name artifacts across attempts. All 1,147 retained files, including that failure, match their declared sizes and hashes.

A fresh read-only independent finish review opened 15 real current-source native captures and found no material UI fixes for this unsigned foundation. Independent documentation review returned OK with notes. It confirmed the native storage, simulator, privacy, assets and Help records, and identified older product/design/platform-boundary wording for a separate documentation follow-up. Neither review is owner, signing, hardware or publication approval.

  • Bun 1.4.2 frozen install, bun run typecheck, bun run lint, bun run test, bun run build:mobile, bun run quality:measure, bun run security: passed locally. 219 unit tests, 1,533 assertions; 10 client journeys; 73 production files/452 functions; highest CRAP 20.0000; zero gate failures.
  • node --test scripts/ios-release/*.test.mjs scripts/ios-assets/*.test.mjs scripts/ios-native/*.test.mjs site/*.test.mjs: 80 tooling/site tests passed. Eight new session/scenario tests require one owned connection, preserve cold relaunch and exact bytes, stop on missing hold/completion effects, and reject unbound flows.
  • actionlint .github/workflows/quality.yml and git diff --check: passed.
  • Fourteen real-SQLite tests use temporary Bun SQLite files. They do not claim Expo/iOS-runtime coverage.
  • Browser-adapter journeys exercise native screen source but not UIKit, native SQLite, actual safe areas or VoiceOver.
  • The first hosted native run successfully compiled and packaged an unsigned Release app at 53bbfd3, then timed out during the first simulator boot. No native UI tests ran. Its retained artifact supplied the reviewed CocoaPods lock.
  • The Windows/Linux jobs exposed a Node 24.21 mixed ESM/CommonJS TypeScript-loading failure before collection. A minimal reproduction isolated the fixture's runtime import of the mobile save module. The dependency-free save-key module removes that crossing without downgrading Node; all ten journeys and the quality gate pass locally on 24.21.
  • The second native run, source beff6ec, passed deployment-mode installation and native setup, hold/reroll and restart/resume on iPhone 17. The SQLite document was byte-identical across relaunch. First boot took about 7½ minutes. Completion failed after two taps did not record scores; the next flow waits for enabled, centered controls and acknowledged scoring. Screenshots also exposed content hidden behind the large navigation header, so the correction uses compact system headers and complete safe-area edges.
  • Inspecting the first built app found Expo FileSystem's privacy resource missing from its precompiled SDK bundle. The repair builds that module from source and compares the built resource and aggregate reasons with upstream. Dependency-only run 36360477119 generated a reviewed two-line lock change without version changes. No privacy or export answers were invented.
  • Historical qualification at 9373563 builds once, then runs four required device groups. Every group verifies the exact source, workflow run, architecture, app identity and artifact hashes before installation. All ten scenarios remain covered. This replaces the serial matrix whose measured startup/driver costs would exceed a one-hour job.
  • The bc040c0 build passed deployment-mode installation and native privacy inspection. Eleven manifests are present, with the SDK's four missing reasons restored. The iPad 8-dice start/resume scenario also passed. Its groups then exposed driver startup, keyboard-dismissal and scoring-tap failures. All four groups failed; none is treated as full qualification.
  • The native trace showed keyboard-dismissal swipes starting a default iPad game. The flow now submits Return. Completion explicitly launches/resumes the app, waits for settled scrolling and requires each recorded score. That earlier flow allowed one no-change retry; current scoring does not retry taps. Driver startup has a five-minute bound, and driver logs/longer recordings are retained for diagnosis.
  • Codex identified reset failure after deletion leaving stale data on screen. Three regressions reproduced it. Legacy cleanup now precedes deletion; acknowledged deletion publishes empty state without a fallible replacement write. Uncertain deletion enters recovery with a distinct Retry reset action.
  • Run 36364492347, source 027459f, completed native iPad games with eight dice solo and ten dice solo/three AI. Ten-dice largest-text start/resume also passed. Both phones still failed their first scoring acknowledgment: traces and screenshots show the target clipped behind the fixed roll footer. Tablet eight-dice AI could not find the first row after resume. The following revision waited for gameplay, centered score targets, retained acknowledgment checks and captured the initial scoring screen.
  • That run also exposed an actual reset defect. The iOS SDK uses E_SQLITE_DELETE_DATABASE for missing files and other failures, not the assumed missing-only code. Real-file reset tests now call the deletion adapter instead of force-removing absent files; six regressions failed before repair. Reset enumerates the directory, removes only owned files and verifies absence. Inspection, permission and still-open failures remain failures. Expo FileSystem 57.0.7 is now a direct dependency at the already installed version; no package versions changed.
  • All 304 declared files downloaded from the 027459f build and four groups match their receipt hashes. An earlier bc040c0 XCTest log changed after hashing. Current publication copies ordinary files into an immutable directory and hashes the same buffers it writes. Hidden-file exclusions match the uploader, and interrupted runs receive failed receipts.
  • Run 36368212879, source 22d76f2, passed both iPad groups: four complete solo/three-AI games, largest iPad text resume, damaged-save/database preservation, cancelled reset, explicit reset and empty relaunch. All 361 declared build/group files match downloaded hashes. Both phone groups still failed, so the required quality gate remained failed.
  • Phone five recorded six upper scores before One Pair moved from y630..686 to y115..171. Its tap opened Help; the saved game confirms no One Pair score. Maestro 2.10.0's centering check is one-sided and its visibility check uses the whole screen. Current scoring uses the same pinned binary's local stdio MCP to inspect actual viewport/row rectangles, make bounded short scrolls, and tap only a fully contained enabled row. It never repeats a tap. Recorded labels, disabled state, final Game Over and persisted completion remain mandatory. Transport/geometry tests are not native acceptance.
  • Run 36372165680, source 1d4f948, passed the full phone-six group, including solo/three-AI completion and largest-text resume. The local MCP driver also completed phone-five and both tablet solo games; tablet-ten AI reached saved results. Phone-five then failed on an offscreen Cancel preview action, tablet-eight AI failed its first score acknowledgment, and tablet-ten AI failed its History navigation. The matrix remained failed. All 862 declared build/group files match downloaded hashes.
  • The Help flow now scrolls to Cancel preview and asserts cancellation, not just a tap. New scoring/results driver sessions explicitly foreground the existing app without stopping it or clearing saved state. The following 930a70d run passed both tablet groups and phone-five solo, including those earlier failures. Geometry checks, single scoring taps, acknowledgments and persisted completion requirements remain unchanged.
  • Codex's enum finding reproduced arrays being coerced into accepted appearance/status values. Explicit string guards now reject them. Two regressions verify failed loading, no exposed game and unchanged original bytes; both failed before repair. The reset and enum threads are resolved. The native dependency-refresh label remains removed. That head's qualification was incomplete. Current source now has the passing qualification described above.
  • Run 36376665362, source 930a70d, passed phone-six and both tablet groups, both largest-text scenarios, damaged-save/database preservation and explicit reset/relaunch. Phone-five solo also passed. Seven of eight complete-game scenarios passed. Phone-five landscape/three-AI failed at its first die interaction, so the matrix remained failed. All 1,065 declared build/group files match downloaded size/hash inventories.
  • That failure put the first die at y320..400 behind the fixed reroll action. The driver accepted whole-screen visibility and tapped130,360; the save records a reroll and no held die. The current driver checks the die against its actual left/shared scroll pane and the reroll action against the play area. It taps each once, then requires both UI acknowledgment and exact persisted effects before continuing. Holding may change only the held index/revision; rerolling must preserve the held face and unrelated saved data. Actual native evidence shows this React Native checkbox's state in its accessibility value, while Maestro's generic checked boolean stays false.
  • The new contract regression failed before the dice guard. Geometry/control tests cover footer overlap, the correct left-pane gesture, reverse correction, malformed/unrelated bounds, missing acknowledgment, saved-state mismatch and bounded stalls. The shared local session retains the existing transport/environment/deadline/cleanup limits. These tests do not prove the new native interaction has passed. The clean Codex review of 8fbf386 is historical; fresh review is required for the current head.
  • Run 36381288453, source 8fbf386, passed compilation, Linux/Windows and mutation checks, but all four native groups stopped before their first hold tap. The native hierarchy places the play View's test ID as a leaf beside its children, not above them. The current guard accepts real ancestry or the observed leaf-marker shape in the same immediate container, with full geometric containment. Die ancestry inside its actual scroll view remains mandatory. A captured hierarchy excerpt reproduced the failure before repair; detached markers and unrelated dice remain rejected. All four original hierarchies now produce valid geometry decisions in the local regression check. All 98 declared build/group files match downloaded inventories. This is not a substitute for the new native run.
  • Source 9373563 passed both phone groups in its original run and the complete same-head evidence-regeneration run. Both tablet groups failed. In attempt 2, tablet-eight's first hold target was fully visible and geometrically contained, but its single tap changed neither the UI nor the saved document. Tablet-ten missed a setup choice-sheet transition. All 739 declared build/four-group files downloaded from attempt 2 match size/hash inventories. Original-run artifacts expired before retrieval; their absent bytes are not claimed as retained evidence. Its clean Codex review is historical.
  • The current reversible experiment shares one existing local MCP connection across each scenario's authored setup/resume/results flows and geometry/effect-checked interactions. It removes repeated CLI/MCP driver changes without changing the app UI, cold termination/relaunch, any scenario, tap policy, effect checks, message/environment limits or ten-minute session deadline. The tablet-ten failure occurred within a CLI phase, so this is not a proven universal repair. Full current-source native qualification is required.
  • Native screenshots and the original recording below are actual simulator evidence from source86011d8. JavaScript exports and browser-adapter images are not substitutes.

Current-source native UI evidence

These original RGB images and explicit pixel-identical RGB exports and the original 7-minute45-second recording come from the passing source86011d8 qualification. They show played games, not injected display fixtures. Expanded iPad captures retain the simulator's original stored orientation. They are engineering evidence, not App Store screenshots or a store-preview video. Phone-six images come from the passing attempt2 artifact.

iPhone17 native setup, light appearance

iPhone17 played five-dice game after held die and reroll

Passing retry, completed six-dice native results in Dark Mode

Passing retry, iPhone largest accessibility text with held die and reachable reroll

iPad expanded ten-dice three-AI native game in light appearance

iPad expanded eight-dice three-AI native game in Dark Mode

iPad largest accessibility text and responsive compact layout

Native local history after actual ten-dice completion

Native damaged-save recovery before any reset

Empty native setup after explicit reset and cold relaunch

Allowlisted native diagnostics preview with explicit share or cancel

Original phone-five qualification recording:

native-resume.mp4

Explicit RGB engineering exports

These exported images have no alpha channel. Every source pixel was fully opaque; the exports preserve decoded color samples, dimensions and all ancillary metadata byte for byte, including the original stored orientation. No compositing, cropping, resizing or overlay was applied. Original captures remain retained and linked below. These are engineering images, not accepted App Store captures.

Original capture for phone-play-light.png

Original capture for phone-largest-text.png

Original capture for tablet-expanded-light.png

Original capture for tablet-expanded-dark.png

Original capture for tablet-largest-text.png

Risks and deferred work

Public identity/rights and release scope remain owner decisions in #39. Existing development identifiers and proposed version 1.0.0/build 1 are not approved public branding. No Apple app record, signing, upload, TestFlight, legal declarations, contact publication or store submission is performed here.

Real-device airplane-mode, VoiceOver, interruption, backup/restore and signed-distribution acceptance remain unproven. The iOS SQLite directory is eligible for OS-controlled backup; Reset does not erase existing backups. No application-level encryption is configured.

See native storage and simulator qualification for the contracts and evidence limits.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T00:24:13.366135Z 86011d8 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HemSoft

HemSoft commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: beff6ec696

ℹ️ 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".

@HemSoft HemSoft added native-pods-refresh Dependency-only native lock refresh. Cannot satisfy qualification. and removed native-pods-refresh Dependency-only native lock refresh. Cannot satisfy qualification. labels Sep 27, 2026
@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@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: bc040c05b0

ℹ️ 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 apps/mobile/src/local/store.ts Resolved
@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 027459f2d4

ℹ️ 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".

@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 22d76f2f90

ℹ️ 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".

@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Current head 1d4f948 replaces the one-sided score-centering shortcut with a local pinned-Maestro viewport/row containment loop, bounded transport and semantic taps without retries. Recorded-score and persisted completion checks remain required. Please review this head, including protocol cleanup and fail-closed geometry. Local qualification and 40 tooling tests pass; native matrix qualification is pending.

@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: 1d4f948624

ℹ️ 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 apps/mobile/src/local/save.ts Resolved
@HemSoft
HemSoft force-pushed the feat/ios-offline-foundation branch from 1d4f948 to 930a70d Compare September 28, 2026 04:11
@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 930a70dfca

ℹ️ 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".

@HemSoft
HemSoft force-pushed the feat/ios-offline-foundation branch from 930a70d to 8fbf386 Compare September 28, 2026 05:17
@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 8fbf38678d

ℹ️ 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".

@HemSoft

HemSoft commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 9373563db3

ℹ️ 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".

@HemSoft
HemSoft force-pushed the feat/ios-offline-foundation branch from 9373563 to 86011d8 Compare October 1, 2026 00:18
@HemSoft

HemSoft commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 86011d88d8

ℹ️ 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".

@HemSoft
HemSoft merged commit 0e3f2fe into main Oct 1, 2026
19 of 21 checks passed
@HemSoft
HemSoft deleted the feat/ios-offline-foundation branch October 1, 2026 04:08
@HemSoft

HemSoft commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Merged at 0e3f2fe. Postmerge dependency security and unpublished site checks passed, but application quality failed two tablet groups. Retained exact original artifacts11140239686 and11140204950: all103declared files match inventory hashes/sizes. Tablet8 reported Device became unreachable during isScreenStatic; tablet10 timed out after saving a completed315-point solo game. One fresh failed-group rerun started October1 at00:44EDT. No existing state-changing tap was replayed; no delivery-success notification has been sent. The original current-head native qualification and public media remain intact.

@HemSoft

HemSoft commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Postmerge delivery is now verified. Application quality run 36813755877 attempt 2 passed after the one fresh tablet-group retry; dependency security 36813755923 and unpublished-site 36813756047 passed. Exact artifact IDs distinguish both original failed tablets from their passing retries. All 1,011 winning declared artifact files matched downloaded sizes/SHA-256, all ten cold resumes preserved the stored document bytes, eight games completed, and both explicit corruption resets produced empty saves. Original device-unreachable/driver-timeout evidence remains retained. This is unsigned simulator delivery only, not signed-device, VoiceOver, airplane-mode, backup/traffic, TestFlight or store acceptance. One completion notification was sent after verification.

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