Skip to content

Scenario 01: Happy Path Inspection Run

Why This Scenario Matters

This is the best first exercise because it introduces almost every core concept in one pass without starting from a fault or edge case.

By the end of the scenario, a newcomer should understand:

  • why the app starts disconnected
  • why connection, recipe loading, homing, and start happen in that order
  • how the UI reflects canonical app state
  • what a normal terminal run looks like
  • where run summary and diagnostics data come from

This scenario is the practical entry point to SLICE-001, with supporting behavior from SLICE-002, SLICE-003, and SLICE-004.

Operator Actions

  1. Launch the application.
  2. Observe that the machine starts in a disconnected state.
  3. Click Connect.
  4. If the current simulator profile causes a connection failure, click Connect again until the machine reaches Connected.
  5. In the Recipe panel, click Refresh if no recipes are visible.
  6. Select a recipe such as standard-5pt-wafer-scan.
  7. Click Load Recipe.
  8. Click Home.
  9. Wait for homing to complete and confirm the machine becomes ready.
  10. Click Start Run.
  11. Watch the Active Run, Live Preview, Subsystem States, Diagnostics, and Run History areas while the run progresses.
  12. Let the run complete normally.

Expected UI And State Changes

On Launch

You should see:

  • Connection as Disconnected
  • Workflow as Idle
  • no loaded recipe
  • Connect available
  • Home and Start Run unavailable

This reflects the initial AppState shape and the command-guard rules rather than ad hoc UI logic.

On Successful Connection

You should see:

  • connection move through Connecting and then Connected
  • diagnostics entries indicating connection activity
  • machine readiness still blocked until a recipe is loaded and homing succeeds

After Recipe Load

You should see:

  • the loaded recipe name update in the left panel
  • the available recipe catalog remain visible for future changes
  • Start Run still blocked because homing has not happened yet

After Homing

You should see:

  • Workflow briefly show Homing
  • Motion return to an idle or ready state
  • Homed: Yes
  • the machine become ready if all other safety preconditions are satisfied

During The Run

You should see:

  • Workflow move through Preparing and then Running
  • stage position values change as scan points execute
  • run progress increase from point to point
  • preview frame text update
  • telemetry values update in the diagnostics panel
  • defect counts and breakdown values change over time
  • diagnostics entries appear for major run events

On Normal Completion

You should see:

  • Workflow move to Completed
  • Last Run Summary show the finished run
  • the newest row appear at the top of Run History
  • run metrics remain visible in history, including profile, duration, points, and defect counts

What To Inspect In Code After Running It

Start with these files:

  • src/InspectionPrototype.Presentation/ViewModels/MainViewModel.cs
  • src/InspectionPrototype.Application/Services/WorkflowService.cs
  • src/InspectionPrototype.Application/Guards/CommandGuards.cs
  • src/InspectionPrototype.Application/State/AppState.cs

Focus on these ideas:

  • how MainViewModel projects one canonical state object into many UI fields
  • how CommandGuards determine when Connect, Home, and Start Run are legal
  • how WorkflowService.StartRunAsync() claims the run slot, creates active run state, and drives the runtime loop
  • how terminal completion produces both LastRunSummary and a new RunHistory item

Troubleshooting Notes

  • If Connect fails on the first try, that can be normal depending on the selected simulator profile. The default Normal profile allows connection failure probability.
  • If no recipes are shown, use Refresh. The app expects file-backed recipes rather than hard-coded seeded recipes now.
  • If Start Run stays disabled after recipe load, check whether homing has completed and whether any active critical fault remains.
  • If the machine still does not become ready, inspect the safety signals on the right panel, especially the emergency stop signal.

Diagram Brief

  • Title: Happy path inspection run
  • Purpose: Show the end-to-end operator flow from launch through normal run completion
  • Audience: newcomer developer or automation engineer
  • Nodes: Operator, MainWindow, MainViewModel, WorkflowService, AppStateStore, MotionController, CameraController, RunHistoryStore
  • Edges: operator commands flow into the view model, then into workflow service; workflow updates app state; pipelines update telemetry and frames; terminal summary is persisted and projected to UI
  • Groups: UI, Application, Infrastructure, Persistence
  • Caption: A normal run is a controlled sequence of guarded operations, not a single button click
  • Destination file path: docs/diagrams/source/scenario-01-happy-path.drawio

Docs-first project memory for AI-assisted implementation.