DEV Community

Rory | QIS PROTOCOL
Rory | QIS PROTOCOL

Posted on

Untitled

On December 31, 2019, the Wuhan Municipal Health Commission reported a cluster of pneumonia cases of unknown etiology. By January 7, 2020, Chinese authorities had identified a novel coronavirus. By January 11, the first genome sequence was publicly available. By January 30, the WHO declared a Public Health Emergency of International Concern.

By then, 8,243 confirmed cases existed across 19 countries. The virus had already been spreading silently for weeks. Estimates from Tuite et al. (2020) suggest international seeding from Wuhan began in mid-to-late January — which means confirmed cases in 19 countries by January 30 represented weeks of unchecked transmission that had already made containment effectively impossible.

The signal was there. The architecture to synthesize it in time was not.

This is Article #039 in the "Understanding QIS" series. Previous articles covered neuroscience (#038) and climate science (#037). The pattern is the same every time: outcome intelligence exists inside distributed systems, architecture prevents it from synthesizing in real time, and the delay costs lives.


The Architecture Failure in COVID-19

The International Health Regulations (IHR 2005) established a legal framework: 194 WHO member states are required to report events that may constitute a public health emergency of international concern. The Global Outbreak Alert and Response Network (GOARN) maintains 250+ technical institutions and networks across 100+ countries, ready to mobilize for verification and response. ProMED-mail has been scanning for outbreak signals since 1994. HealthMap scrapes 100,000+ sources in real time.

Kraemer et al. (2020) documented the first wave: early case counts from Chinese provinces, international travel patterns, and transmission dynamics were simultaneously tracked by multiple academic groups, national health agencies, and WHO. All were analyzing independently. None were synthesizing outcome intelligence in real time.

The epidemiological failure mode in COVID-19 was not data scarcity. It was the absence of a live synthesis loop between:

  • Surveillance signal: National surveillance systems detecting unusual pneumonia clusters
  • Genomic signal: Sequencing labs identifying novel pathogen characteristics
  • Mobility signal: Travel data showing potential seeding events
  • Clinical outcome signal: Hospital systems observing case severity distributions
  • Intervention outcome signal: Quarantine and travel restriction effectiveness data

Each of these signal streams existed. Some were being analyzed in real time. None were connected into a single synthesis loop that could route validated epidemiological outcomes to relevant actors before transmission crossed the containment threshold.

Viboud et al. (2017) described the RAPIDD Ebola challenge: modeling groups were given the same data and produced dramatically different outbreak trajectory estimates. Not because of bad models, but because different groups synthesized different subsets of available evidence. No mechanism routed the highest-validated outcomes back into a shared synthesis layer during the response.


Why Existing Systems Cannot Close the Loop

WHO IHR early warning operates through national Focal Points — designated officials in each member state responsible for communicating with WHO. The system is designed for deliberate human-to-human reporting, not real-time signal synthesis. When a novel pathogen appears, the IHR notification timeline is: local health authority detects → national Focal Point notified → WHO Focal Point informed → WHO PHEIC assessment initiated. Each handoff introduces latency. The batch architecture is by design — it was built for deliberate human judgment, not distributed outcome synthesis.

GOARN excels at rapid deployment of technical expertise once a response is formally activated. It does not provide real-time routing of epidemiological outcome intelligence before activation. Brownstein et al. (2009) documented how HealthMap detected the 2009 H1N1 outbreak signal before official WHO notification — the signal existed, but no architecture routed validated epidemiological outcomes from surveillance platforms to decision-makers in real time.

Federated learning for epidemiology encounters the same structural barriers it faces in healthcare broadly. National surveillance systems maintain patient data under national privacy laws. Sharing gradients trained on line-listed patient data raises re-identification concerns even under differential privacy guarantees. More critically: the epidemiological signal that matters most during a novel outbreak is not a gradient update from a static model — it is a validated outcome packet: this intervention was applied in this population with this result.

Genomic surveillance networks (GISAID, Nextstrain) have dramatically improved real-time pathogen tracking. Hadfield et al. (2018) documented how Nextstrain enables real-time evolutionary analysis of epidemic pathogens. But phylogenetic signal and clinical outcome signal exist in separate systems. A variant flagged in Nextstrain as potentially immune-evasive does not automatically trigger routing of clinical outcome data from sites treating patients with that variant to sites that haven't seen it yet.

The problem is structural. Surveillance generates signal. Labs generate genomic data. Hospitals generate clinical outcome data. Modelers generate trajectory estimates. None of these systems emit validated outcome packets that route to relevant actors across the full epidemiological synthesis loop.


What QIS Routes Instead

QIS — Quadratic Intelligence Swarm — does not route line-listed patient data. It does not route model weights trained on national surveillance data. It routes outcome packets: validated epidemiological deltas observed at a specific site, for a specific pathogen characteristic, under a specific intervention condition.

The EpiOutcomePacket structure for pandemic preparedness looks like this:

  • reporting_node: surveillance system, hospital network, public health agency identifier
  • pathogen_id: WHO-assigned identifier or working label
  • variant_tag: genomic clade or variant designation
  • geographic_resolution: country, province, or functional region
  • outcome_type: "case_severity_distribution", "intervention_effectiveness", "transmission_parameter_delta", "vaccine_effectiveness_delta", "genomic_clade_emergence"
  • outcome_delta: normalized change in the measured epidemiological parameter relative to baseline
  • population_context: age distribution, comorbidity profile, vaccination coverage — metadata, not raw patient data
  • observation_window: temporal validity of the observation
  • semantic_fingerprint: hash of routing-relevant fields

This structure compresses to under 512 bytes. No patient-level data leaves the reporting system. Any node that can compute a validated epidemiological delta participates — regardless of whether it is a national health ministry, a university hospital network, or a field epidemiology team in a resource-limited setting.


The Python Implementation

from __future__ import annotations
import hashlib
import json
import random
from dataclasses import dataclass, field, asdict
from collections import defaultdict


@dataclass
class EpiOutcomePacket:
    reporting_node: str
    pathogen_id: str
    variant_tag: str               # e.g. "JN.1", "XEC", "novel_cluster_A"
    geographic_resolution: str     # e.g. "West Africa", "Southeast Asia", "Global"
    outcome_type: str              # e.g. "case_severity_distribution", "vaccine_effectiveness_delta"
    outcome_delta: float           # normalized delta vs. baseline (positive = worsening)
    population_context: dict       # metadata only — no patient data
    observation_window: str        # e.g. "2025-Q4"
    packet_version: str = "1.0"

    def semantic_fingerprint(self) -> str:
        key = f"{self.pathogen_id}:{self.variant_tag}:{self.outcome_type}"
        return hashlib.sha256(key.encode()).hexdigest()[:16]

    def byte_size(self) -> int:
        return len(json.dumps(asdict(self)).encode("utf-8"))


class EpiOutcomeRouter:
    """
    Routes EpiOutcomePackets between surveillance nodes, clinical networks,
    and modeling groups.

    Three Elections continuously update routing weights:
      - CURATE:  nodes with validated outbreak predictions earn elevated weight
      - VOTE:    nodes whose outcomes improve response decisions accumulate trust
      - COMPETE: pathogen-domain expertise self-organizes around validated signal
    """

    def __init__(self):
        self.nodes: dict[str, dict] = {}
        self.routing_weights: dict[str, float] = defaultdict(lambda: 1.0)
        self.packet_log: list[EpiOutcomePacket] = []
        self.node_trust: dict[str, float] = defaultdict(lambda: 0.5)
        self.domain_expertise: dict[tuple, float] = defaultdict(lambda: 0.5)

    def register_node(
        self,
        node_id: str,
        name: str,
        pathogen_domains: list[str],
        outcome_types: list[str],
        is_lmic: bool = False,
    ) -> None:
        self.nodes[node_id] = {
            "name": name,
            "pathogen_domains": pathogen_domains,
            "outcome_types": outcome_types,
            "is_lmic": is_lmic,
            "packet_count": 0,
        }
        print(f"  [REGISTER] {name} ({node_id}) | domains={pathogen_domains}")

    def validate_outcome(self, packet: EpiOutcomePacket) -> bool:
        if packet.reporting_node not in self.nodes:
            print(f"  [REJECT] Unknown node: {packet.reporting_node}")
            return False
        if packet.byte_size() > 1024:
            print(f"  [REJECT] Packet too large: {packet.byte_size()} bytes")
            return False
        return True

    def route(self, packet: EpiOutcomePacket) -> list[str]:
        """
        Semantic routing: match on pathogen_domain and outcome_type overlap.
        A novel variant severity signal routes to all nodes registered for that
        pathogen domain AND/OR that outcome type.
        """
        if not self.validate_outcome(packet):
            return []

        recipients = []
        for node_id, meta in self.nodes.items():
            if node_id == packet.reporting_node:
                continue
            domain_match = packet.pathogen_id in meta["pathogen_domains"]
            outcome_match = packet.outcome_type in meta["outcome_types"]
            if domain_match or outcome_match:
                weight = self.routing_weights[node_id]
                recipients.append((node_id, weight))

        recipients.sort(key=lambda x: x[1], reverse=True)
        self.packet_log.append(packet)
        self.nodes[packet.reporting_node]["packet_count"] += 1

        routed_to = [n for n, _ in recipients]
        print(
            f"  [ROUTE] {packet.reporting_node} -> {routed_to} "
            f"| pathogen={packet.pathogen_id} variant={packet.variant_tag} "
            f"type={packet.outcome_type} delta={packet.outcome_delta:+.3f} "
            f"size={packet.byte_size()}B fp={packet.semantic_fingerprint()}"
        )
        return routed_to

    def _election_curate(self) -> None:
        """
        CURATE: Nodes with consistent high-magnitude validated epidemiological
        signal earn elevated routing weight. Novel outbreak signals surface;
        noise is deprioritized.
        """
        node_deltas: dict[str, list[float]] = defaultdict(list)
        for p in self.packet_log:
            node_deltas[p.reporting_node].append(abs(p.outcome_delta))
        for node_id, deltas in node_deltas.items():
            avg_signal = min(sum(deltas) / len(deltas), 1.0)
            self.routing_weights[node_id] = round(0.5 + avg_signal * 0.5, 3)

    def _election_vote(self) -> None:
        """
        VOTE: Nodes whose outcomes improve response accuracy accumulate trust.
        A modeling group that predicted transmission accurately gets higher weight
        in the next outbreak's synthesis loop.
        """
        recent = self.packet_log[-30:] if len(self.packet_log) >= 30 else self.packet_log
        node_recent: dict[str, list[float]] = defaultdict(list)
        for p in recent:
            node_recent[p.reporting_node].append(abs(p.outcome_delta))
        node_all: dict[str, list[float]] = defaultdict(list)
        for p in self.packet_log:
            node_all[p.reporting_node].append(abs(p.outcome_delta))
        for node_id in node_recent:
            recent_avg = sum(node_recent[node_id]) / len(node_recent[node_id])
            all_avg = sum(node_all[node_id]) / len(node_all[node_id])
            if recent_avg > all_avg:
                self.node_trust[node_id] = min(1.0, self.node_trust[node_id] + 0.05)
            else:
                self.node_trust[node_id] = max(0.1, self.node_trust[node_id] - 0.02)

    def _election_compete(self) -> None:
        """
        COMPETE: Pathogen-domain expertise self-organizes. Nodes demonstrating
        consistent signal for respiratory coronaviruses receive more incoming
        coronavirus packets. Networks live or die based on validated results.
        """
        for p in self.packet_log:
            key = (p.reporting_node, p.pathogen_id)
            old = self.domain_expertise[key]
            signal = min(abs(p.outcome_delta), 1.0)
            self.domain_expertise[key] = round((old * 0.9) + (signal * 0.1), 3)

    def synthesize(self) -> dict:
        self._election_curate()
        self._election_vote()
        self._election_compete()
        print("\n  === POST-ELECTION STATE ===")
        summary = {}
        for node_id, meta in self.nodes.items():
            trust = self.node_trust[node_id]
            weight = self.routing_weights[node_id]
            count = meta["packet_count"]
            summary[node_id] = {
                "name": meta["name"],
                "routing_weight": weight,
                "trust": round(trust, 3),
                "packets_emitted": count,
                "is_lmic": meta["is_lmic"],
            }
            print(
                f"  {meta['name']:50s} weight={weight:.3f} "
                f"trust={trust:.3f} packets={count}"
            )
        return summary

    def run_simulation(self, cycles: int = 10) -> None:
        outcome_types = [
            "case_severity_distribution",
            "intervention_effectiveness",
            "transmission_parameter_delta",
            "vaccine_effectiveness_delta",
            "genomic_clade_emergence",
        ]
        variants = ["JN.1", "XEC", "novel_cluster_A", "BA.2.86_descendant", "reference_strain"]

        print(f"\n--- SIMULATION START ({cycles} cycles, {len(self.nodes)} nodes) ---")
        n = len(self.nodes)
        print(f"    N={n} nodes → {n*(n-1)//2} unique synthesis pairs")

        for cycle in range(1, cycles + 1):
            print(f"\n[Cycle {cycle:02d}]")
            for node_id, meta in self.nodes.items():
                for domain in meta["pathogen_domains"][:1]:
                    for otype in meta["outcome_types"][:1]:
                        # LMIC nodes observe real signal — architecturally equal
                        base_delta = random.gauss(
                            0.09 if not meta["is_lmic"] else 0.08, 0.05
                        )
                        base_delta = round(max(-0.3, min(0.5, base_delta)), 4)

                        packet = EpiOutcomePacket(
                            reporting_node=node_id,
                            pathogen_id=domain,
                            variant_tag=random.choice(variants),
                            geographic_resolution=meta.get("region", "global"),
                            outcome_type=otype,
                            outcome_delta=base_delta,
                            population_context={
                                "vax_coverage": round(random.uniform(0.3, 0.95), 2),
                                "median_age": random.randint(28, 52),
                            },
                            observation_window=f"2025-Q{(cycle % 4) + 1}",
                        )
                        self.route(packet)

            if cycle % 3 == 0:
                print(f"\n  [ELECTIONS @ cycle {cycle}]")
                self.synthesize()

        print("\n--- SIMULATION END ---")
        print(f"Total packets routed: {len(self.packet_log)}")


# ── Entry point ────────────────────────────────────────────────────────────────

if __name__ == "__main__":
    router = EpiOutcomeRouter()

    # WHO-affiliated and national public health institutions
    router.register_node(
        "who_eios", "WHO Event Information System (EIOS)",
        pathogen_domains=["novel_respiratory", "influenza", "arboviral"],
        outcome_types=["genomic_clade_emergence", "case_severity_distribution"],
    )
    router.register_node(
        "cdc_flu", "US CDC Influenza Division",
        pathogen_domains=["influenza", "novel_respiratory"],
        outcome_types=["transmission_parameter_delta", "vaccine_effectiveness_delta"],
    )
    router.register_node(
        "ecdc", "European Centre for Disease Prevention and Control",
        pathogen_domains=["novel_respiratory", "arboviral", "enteric"],
        outcome_types=["case_severity_distribution", "intervention_effectiveness"],
    )
    router.register_node(
        "phac", "Public Health Agency of Canada",
        pathogen_domains=["influenza", "novel_respiratory"],
        outcome_types=["vaccine_effectiveness_delta", "intervention_effectiveness"],
    )

    # Academic modeling groups
    router.register_node(
        "imperial_mrc", "Imperial College MRC GIDA",
        pathogen_domains=["novel_respiratory", "influenza"],
        outcome_types=["transmission_parameter_delta", "case_severity_distribution"],
    )
    router.register_node(
        "ihme", "IHME Pandemic Response",
        pathogen_domains=["novel_respiratory", "arboviral"],
        outcome_types=["case_severity_distribution", "intervention_effectiveness"],
    )

    # LMIC nodes — architecturally equal participants
    router.register_node(
        "ncdc_nigeria", "Nigeria Centre for Disease Control",
        pathogen_domains=["arboviral", "novel_respiratory", "enteric"],
        outcome_types=["case_severity_distribution", "intervention_effectiveness"],
        is_lmic=True,
    )
    router.register_node(
        "icmr", "Indian Council of Medical Research",
        pathogen_domains=["novel_respiratory", "influenza", "enteric"],
        outcome_types=["vaccine_effectiveness_delta", "transmission_parameter_delta"],
        is_lmic=True,
    )
    router.register_node(
        "paho_field", "PAHO Field Epidemiology (Latin America)",
        pathogen_domains=["arboviral", "novel_respiratory"],
        outcome_types=["intervention_effectiveness", "case_severity_distribution"],
        is_lmic=True,
    )

    router.run_simulation(cycles=10)
Enter fullscreen mode Exit fullscreen mode

The Scenario: Novel Respiratory Pathogen, Week 2

Make the architecture concrete.

WHO EIOS detects a cluster of severe pneumonia cases with unusual hypoxia progression in a region with active surveillance. The initial cluster is 23 cases. It is not yet clear whether this is a novel pathogen, a known pathogen in an unusual population, or an environmental cause. EIOS emits a genomic_clade_emergence packet with outcome_delta=+0.31 (severity above seasonal baseline), variant_tag="novel_cluster_A", observation_window="2025-Q4". The packet compresses to 387 bytes.

Semantic routing delivers the packet to every node registered for novel_respiratory domain or genomic_clade_emergence outcome type: CDC, ECDC, Imperial College MRC GIDA, IHME, and — critically — NCDC Nigeria and ICMR, both of whom have active surveillance networks that have seen unusual respiratory presentations in the same 10-day window.

NCDC Nigeria emits a packet: their field teams have 14 cases of a similar presentation. outcome_delta=+0.28. Their packet routes back to the same synthesis loop. Imperial College GIDA, now holding two independent corroborating severity signals from different continents, adjusts its transmission parameter estimates and emits a transmission_parameter_delta packet. This routes to ECDC and PHAC.

Total time from EIOS detection to multi-node synthesis: one routing cycle.

Under the current IHR architecture: EIOS detects, WHO Focal Point is notified, national Focal Points are queried, responses are aggregated manually. NCDC Nigeria's 14 cases may appear in a WHO situation report three to five days later. Imperial College GIDA may see the NCDC data when it is posted to a preprint server two weeks after that.

The N(N-1)/2 synthesis pairs do not wait for the IHR notification cycle.


Göttingen, Wuhan, and the N=1 Problem

The most consequential outbreak signals often emerge first at nodes that are architecturally excluded from existing synthesis systems.

Zoonotic spillover events — the moment a pathogen jumps from an animal reservoir to a human — tend to occur in geographic settings with limited surveillance infrastructure: wet markets, live animal trade networks, rural wildlife interfaces. These settings are rarely represented in WHO IHR notification chains as primary reporters. Their signal enters the system when a hospital notices an unusual cluster and escalates through national channels.

QIS solves this with the N=1 node argument. A field epidemiology team operating in a spillover-risk zone — a GOARN partner, an MSF field team, a national FETP graduate — can emit a validated EpiOutcomePacket with cohort size of one. One confirmed case of an unusual presentation. The packet participates in the synthesis loop with the same architectural weight as a packet from CDC's influenza division.

Federated learning cannot do this. An FL gradient computed from a single case is statistically meaningless in an aggregation round. The math does not work at N=1. QIS routes any validated delta. Cohort size is metadata that informs interpretation, not a filter that blocks participation.

The difference between a contained outbreak and a pandemic is often measured in days. Days lost to notification latency, to handoff delays, to the absence of a real-time synthesis loop connecting distributed signal to coordinated action.


Comparison: Outcome Routing vs. Existing Pandemic Preparedness Systems

Dimension QIS Outcome Routing WHO IHR / GOARN HealthMap / ProMED (Surveillance) Federated Learning
Real-time synthesis loop Yes — elections update after each routing cycle No — notification chain with deliberate human handoffs Partial — real-time detection, not outcome synthesis Partial — rounds-based
N=1 field site participation Full — any validated delta participates Limited — requires national Focal Point escalation Detection only — no outcome synthesis Excluded — gradient statistically meaningless
LMIC node architectural parity Full — packet weight = observation validity Constrained — IHR capacity requirements Coverage-dependent Requires sufficient local data
Privacy model No patient data leaves the node Aggregate case counts in notifications Open-source media scanning Differential privacy on gradients
Update latency Cycle-level (minutes to hours) Hours to days per notification cycle Near-real-time detection Hours to days per round
Cross-domain synthesis Native — genomic + clinical + mobility outcome packets route together Manual — requires human coordination across system silos Detection only — no synthesis across signal types Domain-specific — separate models

Three Elections in Pandemic Preparedness

The Three Elections are not a governance layer. They are metaphors for natural selection forces acting on the routing network:

CURATE acts like validation selection. An epidemiological modeling group that consistently produces outbreak trajectory estimates validated by subsequent case counts earns elevated routing weight for transmission parameter packets. Empirical track record determines influence — not institutional affiliation.

VOTE acts like outcome selection. Nodes whose synthesized models led to effective intervention decisions — school closures that measurably reduced transmission, vaccine prioritization frameworks that measurably reduced severity — accumulate trust. The WHO IHR process ratifies institutional decisions. The Three Elections ratify validated outcomes.

COMPETE acts like ecological selection. During a novel coronavirus outbreak, nodes with validated coronavirus outcome intelligence receive more incoming coronavirus packets. A surveillance network that demonstrated accurate novel respiratory pathogen detection during COVID-19 is weighted higher for the next novel respiratory emergence. No committee makes this decision — the routing weights encode it automatically.


The Architectural Constraint

The 2005 International Health Regulations represent a genuine achievement: 194 countries legally committed to a shared notification framework. GOARN represents another achievement: 250+ technical institutions ready to deploy within 24 hours of activation. HealthMap, Nextstrain, ProMED, GISAID — each fills a detection or genomic surveillance role that did not exist 20 years ago.

None of these systems close the loop between distributed epidemiological outcome observation and real-time synthesis. That is not a criticism of the systems — it is a description of an architectural constraint.

The constraint is now known. The architecture that closes the loop has been discovered.

QIS routes the smallest meaningful unit of epidemiological intelligence — the validated outcome packet — through a semantic routing layer that matches observations to relevant actors, runs Three Elections as natural selection forces on routing weights, and feeds synthesized results back into the next cycle. Patient data stays local. Field sites with N=1 observations participate. Modeling groups with validated track records are weighted accordingly. The synthesis loop runs in minutes, not notification cycles.

N nodes generate N(N-1)/2 unique synthesis opportunities. 10 nodes produce 45 synthesis pairs. 100 nodes produce 4,950. 1,000 nodes — a realistic global preparedness network — produce 499,500 unique synthesis opportunities, each at O(log N) routing cost per node. The intelligence scales quadratically. The cost does not.

The breakthrough is the complete loop: Raw signal → Local analysis → Outcome packet (~512 bytes) → Semantic fingerprinting → DHT-based routing by similarity → Delivery to relevant nodes → Local synthesis → New outcome packets generated → Loop continues. Not the DHT. Not the outcome packet format. Not the semantic fingerprint. The complete loop.

QIS was discovered by Christopher Thomas Trevethan. The architecture is protected under 39 provisional patents.


Citations

  • Brownstein, J.S. et al. (2009). Surveillance Sans Frontières: Internet-Based Emerging Infectious Disease Intelligence and the HealthMap Project. PLOS Medicine, 6(7), e1000019.
  • Hadfield, J. et al. (2018). Nextstrain: real-time tracking of pathogen evolution. Bioinformatics, 34(23), 4121–4123.
  • Kraemer, M.U.G. et al. (2020). The effect of human mobility and control measures on the COVID-19 epidemic in China. Science, 368(6490), 493–497.
  • Tuite, A.R. et al. (2020). Estimation of COVID-19 outbreak size in Italy. The Lancet Infectious Diseases, 20(5), 537–538.
  • Viboud, C. et al. (2018). The RAPIDD ebola forecasting challenge: Synthesis and lessons learnt. Epidemics, 22, 13–21.
  • WHO International Health Regulations (2005). Third Edition. Geneva: World Health Organization.

Part of the "Understanding QIS" series. Previous: Part 38 — QIS for Neuroscience

Top comments (0)