Public demo. Data resets daily at 3:00 UTC. Don't store anything sensitive.

appsignal-incident-fix

v1.0 active

Classify an AppSignal incident, optionally spawn a fix worktree and open a PR.

View instances
Owner
opensop-worker
SLA
Trigger
api
Tags
appsignalincident-managementfix

Inputs

incident
object · required

Full incident object from AppSignal

incident_id
string · required
incident_number
number · required
app_id
string · required
project
string · required
project_path
string · required
repo
string · required
exception_name
string · required
phase
enum · required
1 2 3 4

Outputs

decision
string
reason
string
gate_passed
boolean

Steps

  1. 1

    Classify incident

    classify-incident judgment

    Decide whether to fix, skip, or defer this incident

    Inputs
    incident_id process.inputs.incident_id incident_number process.inputs.incident_number exception_name process.inputs.exception_name incident process.inputs.incident
    Outputs
    decision (enum) reason (string) file (string) line (number)
    threshold: 0.8 escalation: manual
  2. 2

    Pre-dispatch gate

    pre-dispatch-gate automated if steps.classify-incident.outputs.decision == 'fix'
    Inputs
    incident_id process.inputs.incident_id incident_number process.inputs.incident_number project process.inputs.project repo process.inputs.repo phase process.inputs.phase
    Outputs
    gate_passed (boolean) gate_reason (string)
  3. 3

    Create fix worktree

    create-fix-worktree automated if steps.pre-dispatch-gate.outputs.gate_passed == true
    Inputs
    incident_id process.inputs.incident_id project_path process.inputs.project_path
    Outputs
    worktree_path (string) branch_name (string)
  4. 4

    Run fix swarm

    run-swarm automated if steps.create-fix-worktree.outputs.worktree_path != null
    Inputs
    worktree_path steps.create-fix-worktree.outputs.worktree_path incident process.inputs.incident file steps.classify-incident.outputs.file line steps.classify-incident.outputs.line
    Outputs
    swarm_exit_code (number) diff_summary (string) committed (boolean)
  5. 5

    Safety gate

    safety-gate automated if steps.run-swarm.outputs.committed == true
    Inputs
    worktree_path steps.create-fix-worktree.outputs.worktree_path project process.inputs.project
    Outputs
    files_changed (number) additions (number) critical_path_hit (boolean) gate_passed (boolean) gate_reason (string)
  6. 6

    Push branch and create PR

    push-and-create-pr automated if steps.safety-gate.outputs.gate_passed == true && process.inputs.phase >= '3'
    Inputs
    worktree_path steps.create-fix-worktree.outputs.worktree_path branch_name steps.create-fix-worktree.outputs.branch_name repo process.inputs.repo incident_number process.inputs.incident_number incident_id process.inputs.incident_id exception_name process.inputs.exception_name diff_summary steps.run-swarm.outputs.diff_summary
    Outputs
    pr_url (string) pr_number (number)
  7. 7

    Notify team

    notify-team notification
    Inputs
    incident_number process.inputs.incident_number project process.inputs.project decision steps.classify-incident.outputs.decision reason steps.classify-incident.outputs.reason
    Outputs
    notified (boolean)
Raw definition
---
opensop: '0.1'
process:
  name: appsignal-incident-fix
  tags:
  - appsignal
  - incident-management
  - fix
  owner: opensop-worker
  steps:
  - id: classify-incident
    name: Classify incident
    type: judgment
    inputs:
    - from: process.inputs.incident_id
      name: incident_id
    - from: process.inputs.incident_number
      name: incident_number
    - from: process.inputs.exception_name
      name: exception_name
    - from: process.inputs.incident
      name: incident
    outputs:
    - name: decision
      type: enum
      values:
      - fix
      - skip
      - skip-duplicate
      - defer
    - name: reason
      type: string
    - name: file
      type: string
    - name: line
      type: number
    judgment:
      escalation: manual
      allow_agent: true
      confidence_threshold: 0.8
      require_human_review: false
    description: Decide whether to fix, skip, or defer this incident
  - id: pre-dispatch-gate
    name: Pre-dispatch gate
    type: automated
    inputs:
    - from: process.inputs.incident_id
      name: incident_id
    - from: process.inputs.incident_number
      name: incident_number
    - from: process.inputs.project
      name: project
    - from: process.inputs.repo
      name: repo
    - from: process.inputs.phase
      name: phase
    outputs:
    - name: gate_passed
      type: boolean
    - name: gate_reason
      type: string
    condition: steps.classify-incident.outputs.decision == 'fix'
    validation: lenient
  - id: create-fix-worktree
    name: Create fix worktree
    type: automated
    inputs:
    - from: process.inputs.incident_id
      name: incident_id
    - from: process.inputs.project_path
      name: project_path
    outputs:
    - name: worktree_path
      type: string
    - name: branch_name
      type: string
    condition: steps.pre-dispatch-gate.outputs.gate_passed == true
    validation: lenient
  - id: run-swarm
    name: Run fix swarm
    type: automated
    inputs:
    - from: steps.create-fix-worktree.outputs.worktree_path
      name: worktree_path
    - from: process.inputs.incident
      name: incident
    - from: steps.classify-incident.outputs.file
      name: file
    - from: steps.classify-incident.outputs.line
      name: line
    outputs:
    - name: swarm_exit_code
      type: number
    - name: diff_summary
      type: string
    - name: committed
      type: boolean
    condition: steps.create-fix-worktree.outputs.worktree_path != null
    validation: lenient
  - id: safety-gate
    name: Safety gate
    type: automated
    inputs:
    - from: steps.create-fix-worktree.outputs.worktree_path
      name: worktree_path
    - from: process.inputs.project
      name: project
    outputs:
    - name: files_changed
      type: number
    - name: additions
      type: number
    - name: critical_path_hit
      type: boolean
    - name: gate_passed
      type: boolean
    - name: gate_reason
      type: string
    condition: steps.run-swarm.outputs.committed == true
    validation: lenient
  - id: push-and-create-pr
    name: Push branch and create PR
    type: automated
    inputs:
    - from: steps.create-fix-worktree.outputs.worktree_path
      name: worktree_path
    - from: steps.create-fix-worktree.outputs.branch_name
      name: branch_name
    - from: process.inputs.repo
      name: repo
    - from: process.inputs.incident_number
      name: incident_number
    - from: process.inputs.incident_id
      name: incident_id
    - from: process.inputs.exception_name
      name: exception_name
    - from: steps.run-swarm.outputs.diff_summary
      name: diff_summary
    outputs:
    - name: pr_url
      type: string
    - name: pr_number
      type: number
    condition: steps.safety-gate.outputs.gate_passed == true && process.inputs.phase
      >= '3'
    validation: lenient
  - id: notify-team
    name: Notify team
    type: notification
    inputs:
    - from: process.inputs.incident_number
      name: incident_number
    - from: process.inputs.project
      name: project
    - from: steps.classify-incident.outputs.decision
      name: decision
    - from: steps.classify-incident.outputs.reason
      name: reason
    outputs:
    - name: notified
      type: boolean
  inputs:
  - name: incident
    type: object
    required: true
    description: Full incident object from AppSignal
  - name: incident_id
    type: string
    required: true
  - name: incident_number
    type: number
    required: true
  - name: app_id
    type: string
    required: true
  - name: project
    type: string
    required: true
  - name: project_path
    type: string
    required: true
  - name: repo
    type: string
    required: true
  - name: exception_name
    type: string
    required: true
  - name: phase
    type: enum
    values:
    - '1'
    - '2'
    - '3'
    - '4'
    required: true
  outputs:
  - from: steps.classify-incident.outputs.decision
    name: decision
    type: string
  - from: steps.classify-incident.outputs.reason
    name: reason
    type: string
  - from: steps.pre-dispatch-gate.outputs.gate_passed
    name: gate_passed
    type: boolean
  trigger:
    type: api
  version: '1.0'
  description: Classify an AppSignal incident, optionally spawn a fix worktree and
    open a PR.