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.
Model the lifecycle before the UI
Turn the remote visual inspection blueprint into an explicit aggregate boundary owned by the application.
Build
Prove before continuing
Implement every command and event pair
Make intent, actor authority, allowed source state, committed state, and emitted fact reviewable together.
Build
Prove before continuing
Persist restart-safe records
Separate business identity, provider evidence, command receipts, immutable facts, audit, and downstream delivery.
Build
Prove before continuing
Make concurrency and replay deterministic
Apply optimistic expected versions and aggregate-scoped idempotency before executing effects.
Build
Prove before continuing
Control effects and unknown outcomes
Commit outbox intent atomically, execute effects outside the transaction, and reconcile ambiguous results.
Build
Prove before continuing
Run all hostile fixture scenarios
Exercise the success path plus replay, concurrency, state, and response-loss failures without an account.
Build
Prove before continuing
Trace the RealView Inspection Desk capstone
Follow the maintained source through domain rules, adapter seam, repository transaction, HTTP boundary, UI evidence, and restart test.
Build
Prove before continuing
Qualify the real integration boundary
Replace only reviewed adapter seams and collect independent production evidence without weakening application invariants.
Build
Prove before continuing
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.
type State = "draft" | "entitlement_pending" | "ready" | "viewing" | "coverage_unavailable" | "observation_recorded" | "review_pending" | "accepted" | "rework_required" | "cancelled";
type CommandName = "create_inspection" | "request_entitlement" | "confirm_entitlement" | "open_viewer" | "record_no_coverage" | "record_observation" | "submit_review" | "accept" | "request_rework" | "record_entitlement_expired" | "cancel";
type Command = {
name: CommandName;
aggregateId: string;
expectedVersion: number;
idempotencyKey: string;
};
const transitions = {
"create_inspection": { from: [null], to: "draft", event: "realview_inspection.created" },
"request_entitlement": { from: ["draft"], to: "entitlement_pending", event: "realview_inspection.entitlement_requested" },
"confirm_entitlement": { from: ["entitlement_pending"], to: "ready", event: "realview_inspection.entitlement_confirmed" },
"open_viewer": { from: ["ready", "coverage_unavailable", "rework_required"], to: "viewing", event: "realview_inspection.viewer_opened" },
"record_no_coverage": { from: ["viewing"], to: "coverage_unavailable", event: "realview_inspection.coverage_unavailable" },
"record_observation": { from: ["viewing"], to: "observation_recorded", event: "realview_inspection.observation_recorded" },
"submit_review": { from: ["observation_recorded"], to: "review_pending", event: "realview_inspection.review_requested" },
"accept": { from: ["review_pending"], to: "accepted", event: "realview_inspection.accepted" },
"request_rework": { from: ["review_pending"], to: "rework_required", event: "realview_inspection.rework_requested" },
"record_entitlement_expired": { from: ["ready", "viewing"], to: "entitlement_pending", event: "realview_inspection.entitlement_expired" },
"cancel": { from: ["draft", "entitlement_pending", "ready", "viewing", "coverage_unavailable", "observation_recorded", "review_pending", "rework_required"], to: "cancelled", event: "realview_inspection.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
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.