{
  "commit": "b4a1af4c7dc36f494cf95dff905405cf6e7382dc",
  "platform": "win32",
  "osRelease": "10.0.26100",
  "arch": "x64",
  "node": "v26.13.1",
  "sqlite": "3.54.1",
  "items": 30000,
  "runs": 6,
  "seed": [
    {
      "type": "assistant_message",
      "status": "completed",
      "count": 15000
    },
    {
      "type": "user_message",
      "status": "completed",
      "count": 15000
    }
  ],
  "warmups": 5,
  "measuredRuns": 9,
  "summary": [
    {
      "scenario": "no compaction",
      "actionMs": [
        5.885099999999511,
        5.591100000001461,
        5.757799999999406,
        5.693300000002637,
        5.563500000000204,
        5.496800000000803,
        5.424800000000687,
        5.434499999999389,
        5.405900000001566
      ],
      "returnedMessages": [
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ]
      ],
      "sqlMs": [
        0.21860000000015134,
        0.22149999999965075,
        0.24109999999927823,
        0.2132000000019616,
        0.21489999999903375,
        0.21120000000155414,
        0.2088000000003376,
        0.2114000000001397,
        0.21000000000276486
      ],
      "medianSqlMs": 0.2132000000019616,
      "spreadSqlMs": 0.03229999999894062,
      "medianActionMs": 5.563500000000204,
      "samples": [
        {
          "scenario": "no compaction",
          "ms": 0.21860000000015134,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.22149999999965075,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.24109999999927823,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.2132000000019616,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.21489999999903375,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.21120000000155414,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.2088000000003376,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.2114000000001397,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "no compaction",
          "ms": 0.21000000000276486,
          "vmSteps": 55,
          "runIds": [],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        }
      ]
    },
    {
      "scenario": "early compaction plus later rolled-back compaction",
      "actionMs": [
        5.700299999996787,
        5.5711000000010245,
        5.089299999999639,
        5.458899999997811,
        5.539000000000669,
        5.861699999997654,
        6.066900000001624,
        5.957699999999022,
        5.786199999998644
      ],
      "returnedMessages": [
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ],
        [
          "message:1",
          "message:2",
          "message:3",
          "message:4",
          "message:5",
          "message:6"
        ]
      ],
      "sqlMs": [
        0.24060000000099535,
        0.23709999999846332,
        0.21900000000096043,
        0.26929999999993015,
        0.23729999999704887,
        0.23059999999895808,
        0.297099999999773,
        0.2422999999980675,
        0.25340000000142027
      ],
      "medianSqlMs": 0.24060000000099535,
      "spreadSqlMs": 0.07809999999881256,
      "medianActionMs": 5.700299999996787,
      "samples": [
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.24060000000099535,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.23709999999846332,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.21900000000096043,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.26929999999993015,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.23729999999704887,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.23059999999895808,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.297099999999773,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.2422999999980675,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        },
        {
          "scenario": "early compaction plus later rolled-back compaction",
          "ms": 0.25340000000142027,
          "vmSteps": 248,
          "runIds": [
            "run:1",
            "run:2",
            "run:3",
            "run:4",
            "run:5",
            "run:6"
          ],
          "plan": [
            "MERGE (UNION)",
            "LEFT",
            "MATERIALIZE compaction",
            "SEARCH item USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=? AND type=? AND status=?)",
            "SEARCH run USING INDEX sqlite_autoindex_orchestration_v2_projection_runs_1 (run_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "SCAN compaction",
            "SEARCH run USING INDEX orchestration_v2_projection_runs_thread_ordinal_idx (thread_id=?)",
            "USE TEMP B-TREE FOR ORDER BY",
            "RIGHT",
            "SEARCH message USING INDEX sqlite_autoindex_orchestration_v2_projection_messages_1 (message_id=?)",
            "SCAN compaction"
          ],
          "sql": "\n          WITH compaction AS (\n            SELECT run.ordinal, run.requested_at\n            FROM orchestration_v2_projection_turn_items AS item\n              INDEXED BY orchestration_v2_projection_turn_items_thread_type_idx\n            INNER JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id\n            WHERE item.thread_id = ?\n              AND item.type = 'compaction' AND item.status = 'completed'\n              AND run.status <> 'rolled_back'\n            ORDER BY item.ordinal DESC\n            LIMIT 1\n          )\n          SELECT run.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_runs AS run ON run.thread_id = ?\n          WHERE run.ordinal >= compaction.ordinal\n            OR run.completed_at IS NULL\n            OR run.completed_at >= compaction.requested_at\n            OR run.status IN ('queued', 'preparing', 'starting', 'running', 'waiting')\n          UNION\n          SELECT message.run_id\n          FROM compaction\n          INNER JOIN orchestration_v2_projection_messages AS message\n            ON message.message_id = ?\n          WHERE message.thread_id = ? AND message.run_id IS NOT NULL\n        ",
          "params": [
            "thread:proof",
            "thread:proof",
            "message:1",
            "thread:proof"
          ]
        }
      ]
    }
  ]
}