{
  "schema_version": 1,
  "evidence_type": "executed synthetic operations",
  "command": "python operations_rehearsal.py",
  "passed": true,
  "checks": [
    {
      "id": "crash.rollback",
      "description": "Abrupt process exit before commit rolls back every application write",
      "expected": {
        "exit": 86,
        "unchanged": true,
        "status": "staged"
      },
      "observed": {
        "exit": 86,
        "unchanged": true,
        "status": "staged"
      },
      "passed": true,
      "method": "Child calls os._exit after item, version, batch and audit writes, before commit. Parent reopens SQLite."
    },
    {
      "id": "crash.response",
      "description": "Retry after committed child exits returns original approval",
      "expected": {
        "exit": 87,
        "replayed": true,
        "version": 1,
        "applications": 1
      },
      "observed": {
        "exit": 87,
        "replayed": true,
        "version": 1,
        "applications": 1
      },
      "passed": true,
      "method": "Child commits then exits without returning a response. Parent replays the same batch identity."
    },
    {
      "id": "load.concurrent",
      "description": "Eight suppliers preserve all rows under four concurrent writers",
      "expected": [
        250,
        250,
        250,
        250,
        250,
        250,
        250,
        250
      ],
      "observed": [
        250,
        250,
        250,
        250,
        250,
        250,
        250,
        250
      ],
      "passed": true,
      "method": "Separate SQLite connections stage and commit eight 250-row catalogs. SQLite serializes writes."
    },
    {
      "id": "load.versions",
      "description": "Each concurrent supplier advances exactly once",
      "expected": {
        "SUP0": 1,
        "SUP1": 1,
        "SUP2": 1,
        "SUP3": 1,
        "SUP4": 1,
        "SUP5": 1,
        "SUP6": 1,
        "SUP7": 1
      },
      "observed": {
        "SUP0": 1,
        "SUP1": 1,
        "SUP2": 1,
        "SUP3": 1,
        "SUP4": 1,
        "SUP5": 1,
        "SUP6": 1,
        "SUP7": 1
      },
      "passed": true,
      "method": "Read persisted supplier versions after every worker completes."
    },
    {
      "id": "http.local",
      "description": "Reviewer login and authenticated read succeed",
      "expected": [
        200,
        200
      ],
      "observed": [
        200,
        200
      ],
      "passed": true,
      "method": "Real loopback HTTP requests."
    },
    {
      "id": "http.boundary",
      "description": "Foreign Host and Origin requests are rejected",
      "expected": [
        403,
        403
      ],
      "observed": [
        403,
        403
      ],
      "passed": true,
      "method": "Otherwise authenticated requests with foreign Host or Origin."
    },
    {
      "id": "restart.session",
      "description": "Process-local sessions do not survive restart",
      "expected": 401,
      "observed": 401,
      "passed": true,
      "method": "Create a new application with the same database and replay the old cookie."
    },
    {
      "id": "backup.snapshot",
      "description": "Online snapshot excludes uncommitted data and passes integrity",
      "expected": {
        "transient_rows": 0,
        "integrity": "ok"
      },
      "observed": {
        "transient_rows": 0,
        "integrity": "ok"
      },
      "passed": true,
      "method": "Hold a WAL writer open while SQLite online backup reads a committed snapshot."
    },
    {
      "id": "restore.business",
      "description": "Restored supplier, item, batch and audit content is identical",
      "expected": true,
      "observed": true,
      "passed": true,
      "method": "Verify checksum and integrity, restore to a new directory, hash all business rows."
    },
    {
      "id": "restore.idempotency",
      "description": "Restored batch still prevents duplicate application",
      "expected": true,
      "observed": true,
      "passed": true,
      "method": "Execute approval again against the restored database."
    },
    {
      "id": "restore.corruption",
      "description": "Corrupt snapshot rejected before destination creation",
      "expected": true,
      "observed": true,
      "passed": true,
      "method": "Modify six snapshot bytes; SHA-256 no longer matches."
    },
    {
      "id": "restore.no-overwrite",
      "description": "Existing restore destination is preserved",
      "expected": true,
      "observed": true,
      "passed": true,
      "method": "Attempt restore into an occupied directory."
    },
    {
      "id": "integrity.final",
      "description": "Final source passes integrity and foreign-key checks",
      "expected": {
        "integrity": "ok",
        "foreign_key_errors": 0
      },
      "observed": {
        "integrity": "ok",
        "foreign_key_errors": 0
      },
      "passed": true,
      "method": "PRAGMA integrity_check and foreign_key_check after crashes, imports and backup."
    },
    {
      "id": "backup.schedule",
      "description": "Finite scheduler creates two checked snapshots and stops",
      "expected": {
        "exit": 0,
        "snapshots": 2,
        "valid": 2
      },
      "observed": {
        "exit": 0,
        "snapshots": 2,
        "valid": 2
      },
      "passed": true,
      "method": "Run the supplied CLI in a subprocess with two snapshots and a 10 ms interval. This exercises scheduling without leaving a background process."
    }
  ],
  "source_sha256": {
    "app.py": "a0d869877fa38bd80e468a42253e013604643ddf8ca546cc010a453f1f266f0c",
    "schema.sql": "411fa2f236ef55eedd12258107d4c4dde371e7b3fece85683bcfbdb40ad94185",
    "operations.py": "8a843a53bcc3770b898f119a67fdccec39d072e699dd265f12ea2b9a7c004646",
    "operations_rehearsal.py": "d5a87d2beedd9e1b2c3269400c9661318bd4246115472e8f9c66646b30ab01c1",
    "operations_report.py": "c29103f60dc45531b0fc9ea943d6b760800e49a5861c8d7873c41f08d4df4539",
    "backup_schedule.py": "4442ac5c844508d8198a3f2577d4864cb03882a920cea42b6f2549b9a7403851"
  },
  "report": "operations-report.html",
  "limitations": [
    "Abrupt process termination exercises SQLite recovery, not physical power loss or loss of source and backup together.",
    "Synthetic CSVs and public demonstration accounts were used. The service is loopback-only; no internet deployment or external identity provider is claimed.",
    "Checksums detect accidental modification. Snapshots are not encrypted or digitally signed and need restricted storage permissions.",
    "Durations describe one local run. Detection, provisioning and restart are outside the measured restore copy time.",
    "The 15-minute recovery-point bound is a theoretical schedule requirement, not an enabled backup service."
  ],
  "metrics": {
    "concurrent_imports": {
      "suppliers": 8,
      "rows_per_supplier": 250,
      "workers": 4,
      "elapsed_seconds": 0.0983,
      "committed_rows_per_second": 20353.4,
      "qualification": "One synthetic shared-host run; not sustained production capacity."
    },
    "recovery": {
      "snapshot_bytes": 1036288,
      "snapshot_seconds": 0.008711,
      "restore_seconds": 0.007552,
      "rows": {
        "audit": 18,
        "batches": 9,
        "items": 2004,
        "suppliers": 9
      },
      "nominal_backup_interval_seconds": 900,
      "theoretical_rpo_bound_seconds": 900.008711,
      "rpo_assumption": "A successful snapshot at least every 15 minutes; source and backup not lost together. No unattended schedule was run."
    }
  },
  "python": "3.12.14",
  "elapsed_seconds": 1.366
}
