Advanced2 hr 10 min8 implementation labs5 hostile paths

Build Recoverable navigation session

An eight-lab, source-bounded workshop for the complete navigation session lifecycle: exact commands and events, durable records, replay, concurrency, unknown outcomes, hostile fixtures, a maintained capstone, and production exit evidence.

Durable boundarynavigation session · 6 states · 6 transitions · 6 event identities

Freeze the evidence boundary first

This curriculum teaches the durable host workflow around reviewed Mappls surfaces. It does not manufacture provider endpoints, callbacks, resource states, entitlement, or completion evidence.

The journey blueprint and application event contracts are implementation guidance, not Mappls provider payload specifications.Only linked normalized contracts and source guides may define provider request syntax; empty evidence is never backfilled.The simulator and maintained capstone operate in explicit fixture mode and make no entitlement claim.Credentials, precise production payloads, opaque native objects, and provider secrets stay outside workshop inputs and durable examples.
Lab 1 · 15 min

Model the lifecycle before the UI

Turn the navigation session blueprint into an explicit aggregate boundary owned by the application.

Build

draft: Origin, destination, stops, vehicle profile, and constraints are incomplete or editable.preview: Alternatives and trade-offs are visible but guidance and sensor use have not started.navigating: Guidance owns an active route and consumes position, progress, traffic, and user commands.rerouting: The active route is temporarily superseded by a recalculation caused by deviation, traffic, or destination change.arrived: Arrival policy passed and the application is waiting for confirmation or final trip actions.ended: Sensors, audio, observers, foreground services, and SDK session resources are released.

Prove before continuing

Every persisted state exists in the reviewed blueprint.Terminal states reject ordinary forward commands.Recovery text is operational guidance, not another hidden state.
Lab 2 · 20 min

Implement every command and event pair

Make intent, actor authority, allowed source state, committed state, and emitted fact reviewable together.

Build

calculate_route by Navigation application: draft | preview → preview; emit route.calculated.start_guidance by Driver: preview → navigating; emit navigation.started.request_reroute by Navigation application: navigating | rerouting → rerouting; emit reroute.requested.accept_reroute by Mappls navigation SDK: rerouting → navigating; emit route.updated.confirm_arrival by Navigation application: navigating → arrived; emit navigation.arrived.end_session by Driver: preview | navigating | rerouting | arrived → ended; emit navigation.ended.

Prove before continuing

calculate_route resolves to navigation-session-route-calculated without claiming a provider webhook payload.start_guidance resolves to navigation-session-navigation-started without claiming a provider webhook payload.request_reroute resolves to navigation-session-reroute-requested without claiming a provider webhook payload.accept_reroute resolves to navigation-session-route-updated without claiming a provider webhook payload.confirm_arrival resolves to navigation-session-navigation-arrived without claiming a provider webhook payload.end_session resolves to navigation-session-navigation-ended without claiming a provider webhook payload.
Lab 3 · 15 min

Persist restart-safe records

Separate business identity, provider evidence, command receipts, immutable facts, audit, and downstream delivery.

Build

Route intent: Portable origin, stops, profile, constraints, and version. Keys: intentId, version, waypoints, profile, constraints.Session checkpoint: Minimal recoverable progress without persisting unsafe SDK internals. Keys: sessionId, intentVersion, routeId, legIndex, lastPositionTime.Navigation trace: Privacy-bounded operational and quality evidence. Keys: sessionId, eventType, occurredAt, routeVersion, quality.

Prove before continuing

Process restart restores the same aggregate version and command result.Opaque SDK or native UI objects are not durable records.Provider evidence and application decisions remain distinguishable.
Lab 4 · 15 min

Make concurrency and replay deterministic

Apply optimistic expected versions and aggregate-scoped idempotency before executing effects.

Build

Only one guidance session owns foreground navigation resources at a time.Every route result is applied only to the intent version that requested it.The last valid route remains available while a reroute is pending.Arrival requires an explicit distance, speed, dwell, and stop policy.End releases every observer, sensor, audio, and service resource exactly once in effect.

Prove before continuing

An exact replay returns the first result without another event or version.A reused key with different intent conflicts.A stale expected version changes no durable truth.
Lab 5 · 15 min

Control effects and unknown outcomes

Commit outbox intent atomically, execute effects outside the transaction, and reconcile ambiguous results.

Build

Application process is killed: detect with A persisted active checkpoint exists without a live runtime owner. Recover with Recreate resources, validate destination intent, recalculate if stale, and ask before resuming guidance.GNSS quality degrades: detect with Accuracy, age, speed consistency, or map-matching confidence crosses policy. Recover with Surface degraded positioning, use supported dead-reckoning inputs, and avoid false reroutes.Reroute response arrives after destination changed: detect with Response intent version is older than the active intent. Recover with Discard it and keep the latest calculation; never apply by arrival order alone.Network disappears: detect with Online route, traffic, or search dependency fails while local guidance remains active. Recover with Keep last valid guidance, expose freshness, and use entitled offline capability when available.

Prove before continuing

A timeout remains an unknown outcome until identity-based reconciliation completes.Retries are bounded and preserve the original business and command identities.Dead-letter or manual review retains the entire attempt history.
Lab 6 · 15 min

Run all hostile fixture scenarios

Exercise the success path plus replay, concurrency, state, and response-loss failures without an account.

Build

Complete journey: Commit the shortest reviewed success path to the journey-specific operating target.Idempotent replay: Repeat one command identity and prove that version, event identity, and side effects do not duplicate.Stale version: Reject a command based on an outdated aggregate version without changing durable truth.Invalid transition: Reject a known command when the current state does not permit it.Unknown outcome recovery: Reconcile after a lost response, then replay the original command identity safely.

Prove before continuing

All fixture checks pass for all five scenarios.Rejected commands emit no event and do not increment version.The fixture makes zero provider calls and exposes no write tool.
Lab 7 · 20 min

Trace the Weekend Trip Planner capstone

Follow the maintained source through domain rules, adapter seam, repository transaction, HTTP boundary, UI evidence, and restart test.

Build

Run the app's declared test suite (8 tests).Run fixture mode without a credential.Inspect audit and outbox evidence after each transition.Restart the process and continue the same aggregate.

Prove before continuing

The downloadable archive checksum verifies before execution.The capstone covers the journey target without inventing provider completion.Browser and HTTP surfaces report the same durable version.
Lab 8 · 15 min

Qualify the real integration boundary

Replace only reviewed adapter seams and collect independent production evidence without weakening application invariants.

Build

Route calculation latency and alternative selectionPosition age, accuracy, and map-matching confidenceReroute cause, time, cancellation, and supersessionGuidance session starts without matching cleanupArrival false-positive and manual-override rateCrash/restart recovery outcome

Prove before continuing

Exact product entitlement and regional behavior are validated separately.Provider contract tests cover success, rejection, throttling, timeout, and unknown outcome.Security, privacy, operations, rollback, and product owners approve exact evidence.Fixture completion is never presented as provider or production completion.

Application-owned reliability scaffolds

The aggregate and SQL examples implement host truth; the fixture clients call the credential-free Journey Lab. Replace only the separately reviewed provider adapter seam.

Recoverable navigation session workshop scaffolds
type State = "draft" | "preview" | "navigating" | "rerouting" | "arrived" | "ended";
type CommandName = "calculate_route" | "start_guidance" | "request_reroute" | "accept_reroute" | "confirm_arrival" | "end_session";

type Command = {
  name: CommandName;
  aggregateId: string;
  expectedVersion: number;
  idempotencyKey: string;
};

const transitions = {
  "calculate_route": { from: ["draft", "preview"], to: "preview", event: "route.calculated" },
  "start_guidance": { from: ["preview"], to: "navigating", event: "navigation.started" },
  "request_reroute": { from: ["navigating", "rerouting"], to: "rerouting", event: "reroute.requested" },
  "accept_reroute": { from: ["rerouting"], to: "navigating", event: "route.updated" },
  "confirm_arrival": { from: ["navigating"], to: "arrived", event: "navigation.arrived" },
  "end_session": { from: ["preview", "navigating", "rerouting", "arrived"], to: "ended", event: "navigation.ended" },
} as const;

export function decide(current: { state: State | null; version: number }, command: Command) {
  const rule = transitions[command.name];
  if (command.expectedVersion !== current.version) throw new Error("version_conflict");
  if (!rule.from.includes(current.state as never)) throw new Error("invalid_transition");
  return {
    state: rule.to as State,
    version: current.version + 1,
    event: rule.event,
    idempotencyKey: command.idempotencyKey,
  };
}

// Persist the result, immutable event, audit row, and outbox intent atomically.
// Store the first result by idempotencyKey before executing another effect.

Exit with reviewable evidence

All 6 reviewed transitions are implemented with actor and source-state checks.All 6 application event identities are immutable and versioned.Exact replay, idempotency conflict, stale version, invalid transition, and unknown outcome are tested.Aggregate, event, audit, command result, and outbox intent commit atomically.The Weekend Trip Planner capstone passes 8 declared tests after archive checksum verification.Provider entitlement, payload, callback, completion, and production behavior remain independently evidenced.
Workshop completion is not production authority

Workshop completion proves an application-owned reliability design only. Production still requires issued entitlement, exact adapter contract tests, regional and quota validation, security/privacy review, operational drills, and independent release approval.

Trace every external claim to an indexed source

Break the application before connecting the provider.

Run all five hostile scenarios and the maintained capstone test suite. Then qualify the exact provider seam under independently reviewed non-production entitlement.