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
- Launch the application.
- Observe that the machine starts in a disconnected state.
- Click
Connect. - If the current simulator profile causes a connection failure, click
Connectagain until the machine reachesConnected. - In the
Recipepanel, clickRefreshif no recipes are visible. - Select a recipe such as
standard-5pt-wafer-scan. - Click
Load Recipe. - Click
Home. - Wait for homing to complete and confirm the machine becomes ready.
- Click
Start Run. - Watch the
Active Run,Live Preview,Subsystem States,Diagnostics, andRun Historyareas while the run progresses. - Let the run complete normally.
Expected UI And State Changes
On Launch
You should see:
ConnectionasDisconnectedWorkflowasIdle- no loaded recipe
ConnectavailableHomeandStart Rununavailable
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
Connectingand thenConnected - 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 Runstill blocked because homing has not happened yet
After Homing
You should see:
Workflowbriefly showHomingMotionreturn to an idle or ready stateHomed: Yes- the machine become ready if all other safety preconditions are satisfied
During The Run
You should see:
Workflowmove throughPreparingand thenRunning- 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:
Workflowmove toCompletedLast Run Summaryshow 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.cssrc/InspectionPrototype.Application/Services/WorkflowService.cssrc/InspectionPrototype.Application/Guards/CommandGuards.cssrc/InspectionPrototype.Application/State/AppState.cs
Focus on these ideas:
- how
MainViewModelprojects one canonical state object into many UI fields - how
CommandGuardsdetermine whenConnect,Home, andStart Runare legal - how
WorkflowService.StartRunAsync()claims the run slot, creates active run state, and drives the runtime loop - how terminal completion produces both
LastRunSummaryand a newRunHistoryitem
Troubleshooting Notes
- If
Connectfails on the first try, that can be normal depending on the selected simulator profile. The defaultNormalprofile 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 Runstays 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.
Related Lessons And Specs
- SLICE-001: First Strong Vertical Slice
- SLICE-002: Persistent Run History
- SLICE-003: JSON Recipe File Management
- 01. Async Await Deep Dive
- 06. MVVM in Industrial Systems - Real World
- 08. State Management in .NET - Real World
- 06. Recipe in Industrial Machines
Diagram Brief
Title: Happy path inspection runPurpose: Show the end-to-end operator flow from launch through normal run completionAudience: newcomer developer or automation engineerNodes: Operator, MainWindow, MainViewModel, WorkflowService, AppStateStore, MotionController, CameraController, RunHistoryStoreEdges: 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 UIGroups: UI, Application, Infrastructure, PersistenceCaption: A normal run is a controlled sequence of guarded operations, not a single button clickDestination file path:docs/diagrams/source/scenario-01-happy-path.drawio