Advanced2 hr 10 min8 implementation labs5 hostile paths

Build Consent-bound location capture evidence

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

Durable boundarylocation capture attempt · 8 states · 9 transitions · 9 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 location capture attempt blueprint into an explicit aggregate boundary owned by the application.

Build

draft: The host owns a business purpose, subject or case identity, capture policy, and retention class before requesting device access.permission_pending: The user is deciding the minimum native permission for the declared purpose and visible capture behavior.ready: SDK initialization, entitlement, permission, policy validation, and one launch generation have succeeded.acquiring: Exactly one single-shot request or bounded subscription owns timeout, accuracy, distance, packet-size, callback, and cleanup responsibility.candidate: A returned event has normalized coordinates, horizontal accuracy, event time, receipt time, policy result, and source generation, but is not yet accepted evidence.review_pending: The candidate is usable only with human review because accuracy, freshness, or policy confidence is below the automatic threshold.accepted: An actor accepted one immutable normalized fix for the declared purpose and policy version, with an audit event and retention deadline.cancelled: The user or host ended the attempt and every active SDK resource was stopped or unsubscribed.

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_attempt by Host application: new aggregate → draft; emit location_capture.attempt_created.request_permission by Application user: draft → permission_pending; emit location_capture.permission_requested.prepare_sdk by Platform adapter: permission_pending → ready; emit location_capture.sdk_ready.start_acquisition by Application user: ready | review_pending → acquiring; emit location_capture.acquisition_started.receive_location by Platform adapter: acquiring → candidate; emit location_capture.candidate_received.queue_review by Host application: candidate → review_pending; emit location_capture.review_queued.accept_evidence by Application user: candidate → accepted; emit location_capture.evidence_accepted.approve_weak_evidence by Evidence reviewer: review_pending → accepted; emit location_capture.weak_evidence_approved.cancel_attempt by Application user: draft | permission_pending | ready | acquiring | candidate | review_pending → cancelled; emit location_capture.attempt_cancelled.

Prove before continuing

create_attempt resolves to location-capture-evidence-location-capture-attempt-created without claiming a provider webhook payload.request_permission resolves to location-capture-evidence-location-capture-permission-requested without claiming a provider webhook payload.prepare_sdk resolves to location-capture-evidence-location-capture-sdk-ready without claiming a provider webhook payload.start_acquisition resolves to location-capture-evidence-location-capture-acquisition-started without claiming a provider webhook payload.receive_location resolves to location-capture-evidence-location-capture-candidate-received without claiming a provider webhook payload.queue_review resolves to location-capture-evidence-location-capture-review-queued without claiming a provider webhook payload.accept_evidence resolves to location-capture-evidence-location-capture-evidence-accepted without claiming a provider webhook payload.approve_weak_evidence resolves to location-capture-evidence-location-capture-weak-evidence-approved without claiming a provider webhook payload.cancel_attempt resolves to location-capture-evidence-location-capture-attempt-cancelled 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

Capture attempt: Current host-owned purpose, policy, lifecycle state, generation, and optimistic version. Keys: attemptId, externalId, purpose, policyVersion, state, generation, version.Normalized location evidence: Immutable accuracy-bearing observation independent of the SDK object's lifetime. Keys: evidenceId, latitude, longitude, horizontalAccuracy, eventTime, receivedTime, sourceGeneration, contentHash.Review decision: Attributable disposition of evidence that cannot be accepted automatically. Keys: reviewId, evidenceId, reviewer, decision, reason, decidedAt.Audit and outbox: Append-only transitions and exactly-once-in-effect downstream notification. Keys: eventId, aggregateVersion, actor, idempotencyKey, outboxStatus.

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 permission grant is not consent for every purpose; purpose, policy, and retention are recorded separately.One acquisition generation owns one callback family, timeout, stop, and unsubscribe lifecycle.Accuracy, event time, receipt time, and policy result remain attached to the normalized coordinates.A callback creates a candidate, never an accepted business decision.Weak or stale evidence cannot pass an automatic acceptance threshold by omitting quality fields.Credentials, native manager instances, full opaque payloads, and callback closures never enter durable storage.

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

Permission is denied or restricted: detect with The native authorization result cannot satisfy the declared capture mode. Recover with Explain the affected outcome, offer settings or a manual fallback where appropriate, and keep the attempt non-acquiring.Initialization or entitlement fails: detect with The documented initialize operation returns failure before the generation becomes ready. Recover with Expose a safe configuration or entitlement error, retain no credential value, and require a deliberate retry after correction.Acquisition times out or misses the accuracy budget: detect with The configured deadline expires or every event remains outside policy. Recover with Stop or unsubscribe once, preserve the quality reason, and route to review, retry, or fallback rather than fabricating a precise fix.A callback arrives after cancellation or screen disposal: detect with The owner is inactive or callback generation differs from the current attempt generation. Recover with Ignore the event, perform idempotent cleanup, and do not change the terminal or newer attempt.The app restarts during review: detect with The immutable candidate exists but the review command lacks acknowledgement. Recover with Reload the attempt and replay the same command key; never reacquire or duplicate evidence merely to recover workflow state.

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 Address Verifier 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

Initialization and configuration outcomes by SDK platform and released versionPermission denied, restricted, and settings-return rateTime to first event and time to policy-acceptable eventAccuracy and freshness distributions without high-cardinality coordinate labelsSingle-shot, subscription, timeout, stop, unsubscribe, and late-callback countsAutomatic acceptance, review, retry, fallback, and cancellation rateIdempotency replay and optimistic version conflict rateOutbox backlog, retry, and dead-letter age

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.

Consent-bound location capture evidence workshop scaffolds
type State = "draft" | "permission_pending" | "ready" | "acquiring" | "candidate" | "review_pending" | "accepted" | "cancelled";
type CommandName = "create_attempt" | "request_permission" | "prepare_sdk" | "start_acquisition" | "receive_location" | "queue_review" | "accept_evidence" | "approve_weak_evidence" | "cancel_attempt";

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

const transitions = {
  "create_attempt": { from: [null], to: "draft", event: "location_capture.attempt_created" },
  "request_permission": { from: ["draft"], to: "permission_pending", event: "location_capture.permission_requested" },
  "prepare_sdk": { from: ["permission_pending"], to: "ready", event: "location_capture.sdk_ready" },
  "start_acquisition": { from: ["ready", "review_pending"], to: "acquiring", event: "location_capture.acquisition_started" },
  "receive_location": { from: ["acquiring"], to: "candidate", event: "location_capture.candidate_received" },
  "queue_review": { from: ["candidate"], to: "review_pending", event: "location_capture.review_queued" },
  "accept_evidence": { from: ["candidate"], to: "accepted", event: "location_capture.evidence_accepted" },
  "approve_weak_evidence": { from: ["review_pending"], to: "accepted", event: "location_capture.weak_evidence_approved" },
  "cancel_attempt": { from: ["draft", "permission_pending", "ready", "acquiring", "candidate", "review_pending"], to: "cancelled", event: "location_capture.attempt_cancelled" },
} 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 9 reviewed transitions are implemented with actor and source-state checks.All 9 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 Address Verifier 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.