# E40 §6 Process Job state model — encoded as a transition table. # # Each row is a (from, on) -> (to [, ack]) tuple, mirroring the encoding # in data/control_state.yaml. Events are the lower-snake-case verbs the # loader maps to ProcessJobEvent: start / pause / resume / stop / abort / # hoq / select / setup_complete / process_complete / abort_complete / # created. Host-initiated events (start, pause, resume, stop, abort, # hoq) carry an `ack` when the row should override the default # HostCmdAck::Accept (e.g. a row that only validates an event without # changing state). # # Wire reference: S16F9 PRJOBSTATE byte (E40-0705 §10.3.2): # 0 Queued, 1 SettingUp, 2 WaitingForStart, 3 Processing, # 4 ProcessComplete, 5 Paused, 6 Stopping, 7 Aborting. # # Process-Complete is terminal — deletion happens out-of-band via the # ProcessJobStore (CJ cleanup or explicit S16F13 while still QUEUED). initial: Queued transitions: # --- QUEUED ---------------------------------------------------------- # PJSTOP/PJABORT on a Queued PJ routes through Aborting so the host # observes PRJOBSTATE=7 on the wire (E40-0705 §6.3). PJDELETE / S16F13 # is the dequeue-without-state-change path. - {from: Queued, on: select, to: SettingUp} - {from: Queued, on: hoq} # reorder only, no state change - {from: Queued, on: stop, to: Aborting} - {from: Queued, on: abort, to: Aborting} # --- SETTING-UP ------------------------------------------------------- - {from: SettingUp, on: setup_complete, to: WaitingForStart} - {from: SettingUp, on: stop, to: Stopping} - {from: SettingUp, on: abort, to: Aborting} # --- WAITING-FOR-START ----------------------------------------------- - {from: WaitingForStart, on: start, to: Processing} - {from: WaitingForStart, on: stop, to: Stopping} - {from: WaitingForStart, on: abort, to: Aborting} # --- PROCESSING ------------------------------------------------------- - {from: Processing, on: pause, to: Paused} - {from: Processing, on: stop, to: Stopping} - {from: Processing, on: abort, to: Aborting} - {from: Processing, on: process_complete, to: ProcessComplete} # --- PAUSED ---------------------------------------------------------- - {from: Paused, on: resume, to: Processing} - {from: Paused, on: stop, to: Stopping} - {from: Paused, on: abort, to: Aborting} # --- STOPPING -------------------------------------------------------- - {from: Stopping, on: process_complete, to: ProcessComplete} - {from: Stopping, on: abort, to: Aborting} # --- ABORTING -------------------------------------------------------- - {from: Aborting, on: abort_complete, to: ProcessComplete}