docs: def summary():
      """Summarize the participants' status codes."""
      exp = Experiment(session)
      state = {
          "status": "success",
          "summary": exp.log_summary(),
          "completed": exp.is_complete(),
      }
      unfilled_nets = (
          models.Network.query.filter(models.Network.full != true())
          .with_entities(models.Network.id, models.Network.max_size)
          .all()
      )
      working = (
          models.Participant.query.filter_by(status="working")
          .with_entities(func.count(models.Participant.id))
          .scalar()
      )
      state["unfilled_networks"] = len(unfilled_nets)
      nodes_remaining = 0
      required_nodes = 0
      if state["unfilled_networks"] == 0:
          if working == 0 and state["completed"] is None:
              state["completed"] = True
      else:
          for net in unfilled_nets:
              node_count = (
                  models.Node.query.filter_by(network_id=net.id, failed=False)
                  .with_entities(func.count(models.Node.id))
                  .scalar()
              )
              net_size = net.max_size
              required_nodes += net_size
              nodes_remaining += net_size - node_count
      state["nodes_remaining"] = nodes_remaining
      state["required_nodes"] = required_nodes
  
      if state["completed"] is None:
          state["completed"] = False
  
      # Regenerate a waiting room message when checking status
      # to counter missed messages at the end of the waiting room
      nonfailed_count = models.Participant.query.filter(
          (models.Participant.status == "working")
          | (models.Participant.status == "overrecruited")
          | (models.Participant.status == "submitted")
          | (models.Participant.status == "approved")
      ).count()
      exp = Experiment(session)
      overrecruited = exp.is_overrecruited(nonfailed_count)
      if exp.quorum:
          quorum = {"q": exp.quorum, "n": nonfailed_count, "overrecruited": overrecruited}
          db.queue_message(WAITING_ROOM_CHANNEL, dumps(quorum))
  
      return Response(dumps(state), status=200, mimetype="application/json")