{
  "schema_version": 1,
  "title": "SQLite backup cleanup versus copy completion",
  "generated_at": "2026-10-17T12:09:40.837619+00:00",
  "experiment_type": "Executed native API experiment on constructed data",
  "environment": {
    "sqlite_version": "3.45.1",
    "sqlite_source_id": "2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1",
    "shared_library": "libsqlite3.so.0",
    "python_version": "3.12.3",
    "platform": "Linux-6.8.0-146-generic-x86_64-with-glibc2.39",
    "script_sha256": "bf5aa41b8f0026416d09b7b31cb13ea5bb2f475d437d8ad8bb393144b7fab596"
  },
  "method": {
    "rows_per_database": 64,
    "payload_bytes_per_row": 4096,
    "page_size_bytes": 4096,
    "partial_pages_requested": 8,
    "journal_mode": "DELETE",
    "synchronous": "FULL; set and checked on native source and destination before backup_init",
    "source_generation": 2,
    "initial_destination_generation": 1,
    "copy_scope": "main database only",
    "seed": null,
    "randomness": "None: deterministic, distinct fixtures of equal row count",
    "native_calls": "ctypes calls sqlite3_backup_init/step/finish directly; not Connection.backup",
    "verification": "Close both native handles; reopen read-only; compare every ordered row and run integrity_check",
    "hash_encoding": "SHA256 of UTF-8 JSON ordered row arrays using separators comma and colon",
    "lock_control": "Separate source connection holds BEGIN EXCLUSIVE; no busy handler; abandon after SQLITE_BUSY"
  },
  "sources": [
    "https://www.sqlite.org/c3ref/backup_finish.html",
    "https://www.sqlite.org/backup.html",
    "https://github.com/sqlite/sqlite/blob/version-3.45.1/src/backup.c",
    "https://www.sqlite.org/pragma.html#pragma_integrity_check"
  ],
  "limits": [
    "Four deterministic cases on the recorded SQLite build; not a fleet sample or failure rate.",
    "The abandoned BUSY case expects finish=BUSY, as observed and source-checked for SQLite 3.45.1; this differs from the API prose.",
    "Controlled abandonment, not process crash, power loss or I/O error injection.",
    "No concurrent source changes, throughput measurements or whole-application recovery.",
    "Existing destination in DELETE mode; no WAL destination, attached-database set or wrapper API tested.",
    "Successful logical verification is not a durability or source-freshness guarantee."
  ],
  "cases": [
    {
      "mode": "no-step",
      "steps": [],
      "finish_rc": 0,
      "observed_done": false,
      "source_pages_before": 74,
      "row_count": 64,
      "integrity_check": [
        "ok"
      ],
      "source_unchanged": true,
      "matches_source": false,
      "matches_old_destination": true,
      "accepted_as_completed_copy": false,
      "source_rows_sha256": "63d11b79c5ece99619801ff1e1b1eff1b514b996ba7a3a2a76d050dbf9737c0b",
      "old_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02",
      "reopened_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02"
    },
    {
      "mode": "partial",
      "steps": [
        {
          "rc": 0,
          "remaining": 66,
          "page_count": 74
        }
      ],
      "finish_rc": 0,
      "observed_done": false,
      "source_pages_before": 74,
      "row_count": 64,
      "integrity_check": [
        "ok"
      ],
      "source_unchanged": true,
      "matches_source": false,
      "matches_old_destination": true,
      "accepted_as_completed_copy": false,
      "source_rows_sha256": "63d11b79c5ece99619801ff1e1b1eff1b514b996ba7a3a2a76d050dbf9737c0b",
      "old_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02",
      "reopened_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02"
    },
    {
      "mode": "busy",
      "steps": [
        {
          "rc": 5,
          "remaining": null,
          "page_count": null
        }
      ],
      "finish_rc": 5,
      "observed_done": false,
      "source_pages_before": 74,
      "row_count": 64,
      "integrity_check": [
        "ok"
      ],
      "source_unchanged": true,
      "matches_source": false,
      "matches_old_destination": true,
      "accepted_as_completed_copy": false,
      "source_rows_sha256": "63d11b79c5ece99619801ff1e1b1eff1b514b996ba7a3a2a76d050dbf9737c0b",
      "old_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02",
      "reopened_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02"
    },
    {
      "mode": "complete",
      "steps": [
        {
          "rc": 101,
          "remaining": 0,
          "page_count": 74
        }
      ],
      "finish_rc": 0,
      "observed_done": true,
      "source_pages_before": 74,
      "row_count": 64,
      "integrity_check": [
        "ok"
      ],
      "source_unchanged": true,
      "matches_source": true,
      "matches_old_destination": false,
      "accepted_as_completed_copy": true,
      "source_rows_sha256": "63d11b79c5ece99619801ff1e1b1eff1b514b996ba7a3a2a76d050dbf9737c0b",
      "old_destination_rows_sha256": "7e079584572e39cf5285df5741a4d414def6d20d0b5756b8cdd34c4b01cf4c02",
      "reopened_destination_rows_sha256": "63d11b79c5ece99619801ff1e1b1eff1b514b996ba7a3a2a76d050dbf9737c0b"
    }
  ]
}
