Native Architecture

Decision

Use SwiftUI for the application shell and HUD, with RealityKit hosted in a non-AR ARView for the interactive 3D mechanism. The minimum target is iOS 18.

RealityKit is presentation. The domain model is a deterministic state machine built on integer grid points.

flowchart TD
    Input["Tap / drag / axis input"] --> Session["GameSession"]
    Session --> Rules["Grid paths + occupancy"]
    Rules --> Snapshot["GameSnapshot"]
    Snapshot --> Scene["RealityKit renderer"]
    Snapshot --> HUD["SwiftUI HUD"]

Domain model

Move transaction

1. Resolve the selected piece's active path.

2. Walk nodes in the drag direction.

3. Stop at the first occupied in-bounds node.

4. If no node was entered, emit blocked feedback and leave the snapshot unchanged.

5. Otherwise commit the last legal node, or mark the piece extracted after it exits bounds.

6. Store the previous snapshot for undo.

Axis transaction

1. Create a candidate snapshot with the target axis.

2. For every non-extracted piece, require exactly one active path containing its current origin.

3. Reject the entire transition if any piece fails.

4. Commit once, animate the ring once, and preserve the old path briefly as a ghost.

Rendering

Scaling path