Skip to main content

Keep one accepted document state

The host owns document selection, durable commits, asynchronous job ordering and accepted publication. The native engine owns validation, dependency identity, route resolution, calculation, edit mappings and mutation admission.

Save and reopen​

Validate before adopting a portable document. Keep the saved intent JSON and host metadata under one durable coordinator. Aeronautic's existing PlanningDocumentCoordinator and TripStore implement the SQLite boundary; the registry survives view lifetimes. Reopening must recover the same document and its latest durable commit before deriving current output.

Do not persist a second editable route assembled from the draw projection. App-specific trip records can retain names, airport metadata and store identity alongside the portable intent. Imported legacy data carries an explicit lossless, lossy or unsupported assessment.

Publish geometry, then calculations​

Capture one immutable set of resources and current dependency keys. Accept a lateral result from resolve only while its evaluation is still pending. Later evaluation must supersede that result; a delayed resolve callback must not replace an already accepted calculation.

Publish snapshot and draw together. The map consumes the accepted projection and its snapshot identity. Display profiles are MSL approximations; scientific trajectory heights retain their pressure-altitude basis. Display geometry is not a terrain-clearance calculation. A missing calculation is displayed as missing, even if the current path can be drawn.

Edit a captured occurrence​

  1. Obtain the hit identity from the accepted edit mapping.
  2. Capture document/commit, leg, mapping IDs and slot/navigation context at gesture start.
  3. Submit a bounded-time command to map-edit with the current intent and accepted result.
  4. Commit the returned intent through the coordinator and derive a fresh publication.

Repeated visits have distinct element IDs. Generated terminal vertices may be read-only. A rendered edge does not automatically permit insertion. Clearing or reselecting the map changes the slot context; an old gesture must reject even if the same document returns.

The executable example performs insert, replace and delete, and verifies that editing the second visit to a repeated fix leaves the first untouched.

Reconcile competing edits​

Compare the persisted head with the command's base commit before writing. A conflicting cloud head must not silently win by arrival time. Preserve the divergent branch for explicit reconciliation; retries need stable command identity and may not write twice. Clear/reselect and conflict decisions belong to the durable host owner, not the renderer.

Reuse with proof​

Reuse an unchanged leg only through native reuse, retaining the original admitted intent, resources and result. The new envelope names the current commit; its sealed native products remain unchanged. Publication and the independent reader require the retained source proof. A changed weather, aircraft, departure, runway or other bound input expires eligibility. Never treat a matching route string as a reuse receipt.

Host acceptance checks​

These are source-checkout integration tests, not commands offered by a public server:

bash apps/ios/PlanningNative/test-swift-package.sh \
--filter PlanningDocumentNativePipelineTests

The native pipeline tests cover SQLite save/reopen, accepted snapshot/draw publication, map edits and unchanged-leg reuse across a coordinator restart. The Planning package's PlanningDocumentCoordinatorTests cover reselection, competing connections and write retries; PlanningDocumentCloudTests cover the conflict owner. Run the owner's test wrapper when changing these host behaviors. The CLI example's JSON round trip does not certify a new client's database or synchronization implementation.