Rz-coder8848/moon-fsm/examples/incident_workflow does not have a README file

    IncidentContext

    type IncidentContext

    Production incident context retained across an incident response run.

    IncidentRunbook

    pub(all) struct IncidentRunbook {
    title : String
    steps : Array[RunbookStep]
    }

    A response runbook selected by incident severity.

    RunbookReview

    pub(all) struct RunbookReview {
    required_total : Int
    required_completed : Int
    missing_required : Array[String]
    next_owner : String?
    complete : Bool
    escalation_required : Bool
    }

    Review result produced before an incident response is handed over.

    RunbookStep

    pub(all) struct RunbookStep {
    name : String
    event : String
    owner : String
    required : Bool
    }

    A deterministic runbook step used to guide operators through a response.

    completed_required_steps

    fn completed_required_steps(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> Int

    Counts completed required runbook steps.

    first_event_for_owner

    fn first_event_for_owner(runbook : IncidentRunbook, owner : String) -> String?

    Finds the first event assigned to a role, if the role is in the runbook.

    handover_message

    fn handover_message(review : RunbookReview) -> String

    Returns a stable handover message with the next responsible owner.

    missing_runbook_events

    fn missing_runbook_events(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> Array[String]

    Builds a list of required events absent from a successful history.

    missing_steps_message

    fn missing_steps_message(review : RunbookReview) -> String

    Converts missing events into an operator-friendly handover sentence.

    next_runbook_owner

    fn next_runbook_owner(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> String?

    Returns the owner responsible for the first incomplete required step.

    next_runbook_step

    fn next_runbook_step(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> RunbookStep?

    Finds the first runbook step not represented by successful history.

    owner_has_pending

    fn owner_has_pending(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]], owner : String) -> Bool

    Returns whether an operator still owns mandatory work.

    pending_steps_for_owner

    fn pending_steps_for_owner(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]], owner : String) -> Int

    Counts the required steps still assigned to one role.

    remaining_required_steps

    fn remaining_required_steps(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> Int

    Returns the number of required steps that remain after a history.

    required_runbook_owners

    fn required_runbook_owners(runbook : IncidentRunbook) -> Array[String]

    Returns all required owners, preserving their runbook order.

    required_runbook_steps

    fn required_runbook_steps(runbook : IncidentRunbook) -> Int

    Counts required runbook steps without inspecting execution history.

    requires_commander

    fn requires_commander(severity : Int, review : RunbookReview) -> Bool

    Applies the critical-response escalation rule used by the example.

    review_line

    fn review_line(review : RunbookReview) -> String

    Produces a compact review record for a handover document.

    review_runbook

    fn review_runbook(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]], severity : Int) -> RunbookReview

    Reviews completion and escalation readiness for an incident handover.

    runbook_completion_percent

    fn runbook_completion_percent(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> Int

    Computes an integer completion percentage for dashboards.

    runbook_event_index

    fn runbook_event_index(runbook : IncidentRunbook, event : String) -> Int?

    Returns the zero-based position of an event in the runbook.

    runbook_events

    fn runbook_events(runbook : IncidentRunbook) -> Array[String]

    Returns the event names in operator-facing runbook order.

    runbook_for_severity

    fn runbook_for_severity(severity : Int) -> IncidentRunbook

    Returns the standard response runbook for a severity level.

    runbook_has_event

    fn runbook_has_event(runbook : IncidentRunbook, event : String) -> Bool

    Checks whether an event is part of a runbook.

    runbook_owners

    fn runbook_owners(runbook : IncidentRunbook) -> Array[String]

    Returns unique owners in the order they first appear in the runbook.

    runbook_progress

    fn runbook_progress(runbook : IncidentRunbook, history : Array[
    TransitionRecord
    [String, String]]) -> String

    Returns a human-readable progress string for operator consoles.

    safe_to_close

    fn safe_to_close(review : RunbookReview, journal :
    WorkflowJournal
    ) -> Bool

    A closure gate requires all mandatory steps and no unacknowledged incidents.

    severity_label

    fn severity_label(severity : Int) -> String

    Labels a severity for operator-facing handover records.

    steps_for_owner

    fn steps_for_owner(runbook : IncidentRunbook, owner : String) -> Array[RunbookStep]

    Lists every step owned by one operational role.