Advanced2 hr 10 min8 implementation labs5 hostile paths

Build Fleet geofence exception

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

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

Build

draft: Geometry, rule semantics, asset scope, schedule, and notification policy are being validated.active: The versioned zone is deployed and evaluated against an explicit asset and schedule scope.breached: A debounced enter, exit, dwell, or prohibited-presence event created an operational case.acknowledged: A named operator owns investigation, severity, and response deadline.resolved: The outcome and evidence are recorded without erasing the initiating activity.retired: The zone no longer generates new cases but historical activities remain queryable.

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

publish_geofence by Fleet administrator: draft → active; emit geofence.published.record_breach by Telematics service: active | breached → breached; emit geofence.breached.acknowledge_case by Operations controller: breached → acknowledged; emit geofence_case.acknowledged.resolve_case by Operations controller: acknowledged → resolved; emit geofence_case.resolved.retire_geofence by Fleet administrator: draft | active → retired; emit geofence.retired.

Prove before continuing

publish_geofence resolves to fleet-geofence-exception-geofence-published without claiming a provider webhook payload.record_breach resolves to fleet-geofence-exception-geofence-breached without claiming a provider webhook payload.acknowledge_case resolves to fleet-geofence-exception-geofence-case-acknowledged without claiming a provider webhook payload.resolve_case resolves to fleet-geofence-exception-geofence-case-resolved without claiming a provider webhook payload.retire_geofence resolves to fleet-geofence-exception-geofence-retired 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

Geofence definition: Versioned geometry, schedule, assets, and rule policy. Keys: ruleId, version, providerId, geometryHash, assetScope, status.Source activity: Immutable enter, exit, dwell, or presence evidence. Keys: activityId, ruleVersion, deviceId, eventTime, position.Exception case: Human ownership, SLA, disposition, and notification state. Keys: caseId, activityIds, severity, owner, status, resolution.

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

Geometry and coordinate reference are validated before publication.Every activity names the geofence definition version that evaluated it.Noise suppression never deletes raw source observations.One provider activity creates at most one operational case per rule version.Retirement stops new evaluation while preserving case and audit history.

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

GPS jitter creates repeated boundary crossings: detect with Alternating activities occur inside the configured hysteresis time and distance. Recover with Debounce into one case while retaining raw activities for review.Rule update races with incoming activity: detect with The activity cites an earlier provider or internal definition version. Recover with Evaluate and display it under the cited version; never reinterpret history silently.Provider deletion times out: detect with Internal retirement is pending and provider reconciliation is unknown. Recover with Retry the same delete identity and keep the rule visibly retiring until confirmed.Notification delivery fails: detect with The case exists but the notification outbox remains pending. Recover with Retry independently and escalate by age; do not create another case.

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 Fleet Geofence Monitor 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

Activities per device and rule before and after debouncingCase acknowledgement and resolution timeRules with provider/internal version driftNotifications pending, retrying, and dead-letteredGeometry validation and publication failuresRetired rules still receiving activity

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.

Fleet geofence exception workshop scaffolds
type State = "draft" | "active" | "breached" | "acknowledged" | "resolved" | "retired";
type CommandName = "publish_geofence" | "record_breach" | "acknowledge_case" | "resolve_case" | "retire_geofence";

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

const transitions = {
  "publish_geofence": { from: ["draft"], to: "active", event: "geofence.published" },
  "record_breach": { from: ["active", "breached"], to: "breached", event: "geofence.breached" },
  "acknowledge_case": { from: ["breached"], to: "acknowledged", event: "geofence_case.acknowledged" },
  "resolve_case": { from: ["acknowledged"], to: "resolved", event: "geofence_case.resolved" },
  "retire_geofence": { from: ["draft", "active"], to: "retired", event: "geofence.retired" },
} 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 5 reviewed transitions are implemented with actor and source-state checks.All 5 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 Fleet Geofence Monitor 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.