{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "Rubric Rumble: insert evaluated candidates into a ranking",
    "quality_profile": "showcase",
    "animation": "none",
    "column_fit": "spread",
    "viewBox": [
      1000,
      520
    ]
  },
  "participants": [
    {
      "id": "rr-ladder-seed",
      "type": "database",
      "label": "Candidate order"
    },
    {
      "id": "rr-ladder-core",
      "type": "backend",
      "label": "Tournament core"
    },
    {
      "id": "rr-ladder-views",
      "type": "database",
      "label": "Candidate views"
    },
    {
      "id": "rr-ladder-judge",
      "type": "backend",
      "label": "Judge callback"
    },
    {
      "id": "rr-ladder-ladder",
      "type": "database",
      "label": "Current ladder"
    }
  ],
  "messages": [
    {
      "id": "rr-03-ladder-1",
      "from": "rr-ladder-seed",
      "to": "rr-ladder-core",
      "label": "Deduplicated candidate order",
      "y": 160.0
    },
    {
      "id": "rr-03-ladder-2",
      "from": "rr-ladder-core",
      "to": "rr-ladder-views",
      "label": "Finish all candidate evaluation first",
      "y": 190.0
    },
    {
      "id": "rr-03-ladder-3",
      "from": "rr-ladder-views",
      "to": "rr-ladder-core",
      "label": "Complete answer bundles; failed candidates skip",
      "y": 220.0,
      "variant": "return"
    },
    {
      "id": "rr-03-ladder-4",
      "from": "rr-ladder-core",
      "to": "rr-ladder-ladder",
      "label": "First surviving candidate starts the ladder",
      "y": 250.0
    },
    {
      "id": "rr-03-ladder-6",
      "from": "rr-ladder-core",
      "to": "rr-ladder-judge",
      "label": "A and incumbent B: complete answer bundles",
      "y": 280.0
    },
    {
      "id": "rr-03-ladder-7",
      "from": "rr-ladder-judge",
      "to": "rr-ladder-core",
      "label": "One of five supported outcomes",
      "y": 310.0,
      "variant": "return"
    },
    {
      "id": "rr-03-ladder-8",
      "from": "rr-ladder-core",
      "to": "rr-ladder-ladder",
      "label": "A better: insert A before B",
      "y": 340.0
    },
    {
      "id": "rr-03-ladder-9",
      "from": "rr-ladder-core",
      "to": "rr-ladder-ladder",
      "label": "B better: advance; append A if no win",
      "y": 370.0
    },
    {
      "id": "rr-03-ladder-10",
      "from": "rr-ladder-core",
      "to": "rr-ladder-ladder",
      "label": "Disqualify A, B or both: apply outcome below",
      "y": 400.0,
      "variant": "security"
    },
    {
      "id": "rr-03-ladder-14",
      "from": "rr-ladder-ladder",
      "to": "rr-ladder-core",
      "label": "Ranking + battle records + disqualifications",
      "y": 430.0,
      "variant": "return"
    }
  ],
  "cards": [
    {
      "dot": "rose",
      "title": "Disqualification changes the current insertion",
      "items": [
        "A: remove A and stop. B: remove B, keep A at this position. Both: remove both and stop A. Continue with the next surviving candidate."
      ]
    },
    {
      "dot": "amber",
      "title": "Comparisons follow insertion needs",
      "items": [
        "The order can require every pair in the worst case. The workflow seeds fresh by ID; library callers can supply prior rank or price for seeding. Judgments decide winners."
      ]
    }
  ]
}
