Advanced2 hr 10 min8 implementation labs5 hostile paths

Build Connected fleet trip

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

Durable boundarytrip · 6 states · 7 transitions · 7 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 trip blueprint into an explicit aggregate boundary owned by the application.

Build

planned: Stops, service window, asset, driver, and business identifiers are fixed enough to create the trip.ready: The trip and assigned device are provisioned, entitled, and emitting sufficiently fresh location.active: Positions, events, progress, ETA, and exception state are continuously observed.exception: A deviation, delay, device gap, geofence, or safety event requires operator attention.closing: Arrival is plausible but late events, final proof, and device state are still being reconciled.closed: The provider trip and internal aggregate are closed with a final trace, metrics, and exception record.

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

create_trip by Fleet planner: new aggregate → planned; emit trip.created.confirm_device_ready by Telematics service: planned → ready; emit trip.ready.start_trip by Driver: ready → active; emit trip.started.raise_exception by Telematics service: active | exception → exception; emit trip.exception_raised.resolve_exception by Operations controller: exception → active; emit trip.exception_resolved.request_close by Driver: active | exception → closing; emit trip.close_requested.close_trip by Telematics service: closing → closed; emit trip.closed.

Prove before continuing

create_trip resolves to connected-fleet-trip-trip-created without claiming a provider webhook payload.confirm_device_ready resolves to connected-fleet-trip-trip-ready without claiming a provider webhook payload.start_trip resolves to connected-fleet-trip-trip-started without claiming a provider webhook payload.raise_exception resolves to connected-fleet-trip-trip-exception-raised without claiming a provider webhook payload.resolve_exception resolves to connected-fleet-trip-trip-exception-resolved without claiming a provider webhook payload.request_close resolves to connected-fleet-trip-trip-close-requested without claiming a provider webhook payload.close_trip resolves to connected-fleet-trip-trip-closed 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

Trip aggregate: Current operational state and identity mapping. Keys: tripId, externalId, providerTripId, deviceId, state, version.Telemetry envelope: Immutable position and vehicle observation. Keys: sourceEventId, deviceId, eventTime, receivedTime, position, quality.Exception case: Operator-owned acknowledgement and resolution workflow. Keys: caseId, rule, severity, owner, status, sourceEventIds.Trip revision: Recomputed summary when bounded late data arrives. Keys: tripId, revision, inputWatermark, metrics, generatedAt.

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

A device is assigned to at most one active trip in the same operational context.Raw telemetry is immutable and distinguished by event time and receipt time.Derived live state can be rebuilt from ordered observations and commands.Trip closure never discards unresolved exceptions or data gaps.Every provider identifier is mapped to the internal trip and tenant.

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

Telemetry arrives late or out of order: detect with Event time is behind the trip watermark or its sequence creates a gap. Recover with Store raw input, recompute the bounded affected window, and publish a new derived revision.Device stops reporting: detect with Freshness exceeds the vehicle-specific health threshold. Recover with Raise a connection exception, show last-known time explicitly, and avoid extrapolating authoritative position.Close succeeds remotely but the response is lost: detect with Internal trip remains closing while provider detail reports closed. Recover with Reconciliation closes the internal aggregate with the original command identity.Driver or vehicle assignment changes mid-trip: detect with A control-plane version differs from the assignment captured at trip start. Recover with Use an explicit transfer transition and retain both assignment intervals.

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 Delivery Control Tower 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 (7 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

Telemetry freshness, ordering lag, rejection, and qualityActive trips without a healthy assigned deviceETA error and route-deviation durationOpen exception age by severity and ownerTrips stuck in closing and reconciliation outcomesRaw-to-derived lineage and revision count

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.

Connected fleet trip workshop scaffolds
type State = "planned" | "ready" | "active" | "exception" | "closing" | "closed";
type CommandName = "create_trip" | "confirm_device_ready" | "start_trip" | "raise_exception" | "resolve_exception" | "request_close" | "close_trip";

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

const transitions = {
  "create_trip": { from: [null], to: "planned", event: "trip.created" },
  "confirm_device_ready": { from: ["planned"], to: "ready", event: "trip.ready" },
  "start_trip": { from: ["ready"], to: "active", event: "trip.started" },
  "raise_exception": { from: ["active", "exception"], to: "exception", event: "trip.exception_raised" },
  "resolve_exception": { from: ["exception"], to: "active", event: "trip.exception_resolved" },
  "request_close": { from: ["active", "exception"], to: "closing", event: "trip.close_requested" },
  "close_trip": { from: ["closing"], to: "closed", event: "trip.closed" },
} 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 7 reviewed transitions are implemented with actor and source-state checks.All 7 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 Delivery Control Tower capstone passes 7 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.