{
  "schema": "turkos-public-development-evidence/v1",
  "originalReport": {
    "path": "reports/os-implementation/K2165-update-slots-slots-local-yPvskU/report.json",
    "sha256": "ad72d5edfd41e46939f8a8fff62451445a5450ebae7eb831490c620acdaf4aba",
    "bytes": 18573
  },
  "status": "K2161_K2164_LOCAL_VALIDATED",
  "scope": "# Update Slots A/B Read-Only Version Slot Contract (`K2161–K2165`)\n\n1. **Active Slot Read-Only Invariant (`Etkin yuva güncellemede yazılmaz`)**:\n   - At any point in runtime, exactly one slot (`SlotId::A` or `SlotId::B`) is the active read-only running slot (`SlotRole::ActiveReadOnly`) and the opposite slot is the inactive staging target (`SlotRole::InactiveStaging`).\n   - Any attempt to begin staging, write image chunks, truncate, abort, or Seal an update on the active slot (`target == active_slot`) is immediately refused with `Error::ActiveSlotReadOnly` before touching slot storage or advancing staging counters.\n   - Throughout any update attempt (whether committed or rejected/aborted), the active slot's image bytes, version, entry address, and domain-separated `TurkOS/ELF-PROGRAM/v1\\0` SHA-256 digest (`program_hash`) remain strictly immutable.\n\n2. **Temporary Staging Disk Write to Inactive Slot B (`Geçici diskte B yeni imaj`)**:\n   - Staging begins only on the inactive slot (`SlotId::B` when `SlotId::A` is active) with a strictly higher version (`version > active_version`), non-zero entry address, non-zero expected code/data sizes within `MAX_SLOT_BYTES`, and a non-zero expected `TurkOS/ELF-PROGRAM/v1\\0` SHA-256 digest.\n   - Image chunks are written sequentially into the temporary staging disk buffer of the inactive slot without overlap or gap (`offset == written_bytes`).\n   - `finalize_staging` succeeds only when `written_bytes == expected_bytes` and the recomputed `TurkOS/ELF-PROGRAM/v1\\0` SHA-256 digest over the staged code and data slices matches `expected_digest`, transitioning the inactive slot to `SlotPhase::StagedReady` while keeping the active slot `SlotId::A` read-only and unchanged.\n\n3. **Incomplete Update & Active-Slot Write Refusal (`A üzerine incomplete update`)**:\n   - Writing to `SlotId::A` while `SlotId::A` is active, attempting to finalize when `written_bytes < expected_bytes` (`Error::IncompleteUpdate`), writing past `expected_bytes` or at a non-contiguous offset (`Error::OffsetMismatch`), or finalizing with a digest mismatch (`Error::DigestMismatch`) is rejected and rolls back the staging lease (`staging_leases == 0`, inactive slot returned to `SlotPhase::Empty`, staging buffer zeroed), preserving the active slot's bytes and SHA-256 digest unchanged.\n",
  "productAccepted": false,
  "tests": {
    "greenCount": 4,
    "positiveName": "os_update_slots_slots_positive",
    "negativeName": "os_update_slots_slots_negative",
    "mutationsRejected": 21
  },
  "caseCount": 0,
  "caseSerialsSelected": 0,
  "imageSha256": null,
  "files": [
    {
      "name": "Cargo.toml",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/source/os-update-slots/Cargo.toml",
      "originalSha256": "c3e5406bc0121d9f488812c52871060741153cd14f7b32cf54074f351a234e15",
      "href": "/os-evidence/c3e5406bc0121d9f488812c52871060741153cd14f7b32cf54074f351a234e15.txt",
      "sha256": "c3e5406bc0121d9f488812c52871060741153cd14f7b32cf54074f351a234e15",
      "bytes": 104,
      "redacted": false
    },
    {
      "name": "UPDATE_SLOTS_SLOTS_CONTRACT.md",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/source/kernel/UPDATE_SLOTS_SLOTS_CONTRACT.md",
      "originalSha256": "3ef1db4ad7d11b4404fcd42ff5805de1a9b3167ce9beca1ffc92ca52e07740ae",
      "href": "/os-evidence/3ef1db4ad7d11b4404fcd42ff5805de1a9b3167ce9beca1ffc92ca52e07740ae.txt",
      "sha256": "3ef1db4ad7d11b4404fcd42ff5805de1a9b3167ce9beca1ffc92ca52e07740ae",
      "bytes": 2320,
      "redacted": false
    },
    {
      "name": "lib.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/source/os-update-slots/src/lib.rs",
      "originalSha256": "20a3d319b212ba732c4c482d032a20784aba0509c668f94f0aff92af6a3f42ac",
      "href": "/os-evidence/20a3d319b212ba732c4c482d032a20784aba0509c668f94f0aff92af6a3f42ac.txt",
      "sha256": "20a3d319b212ba732c4c482d032a20784aba0509c668f94f0aff92af6a3f42ac",
      "bytes": 51,
      "redacted": false
    },
    {
      "name": "slots.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/source/os-update-slots/src/slots.rs",
      "originalSha256": "a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4",
      "href": "/os-evidence/a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4.txt",
      "sha256": "a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4",
      "bytes": 16882,
      "redacted": false
    },
    {
      "name": "slots.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/source/os-update-slots/tests/slots.rs",
      "originalSha256": "799395a76216442a6d63ea218c5495148309ded3528ee3229477104ac2bfaae5",
      "href": "/os-evidence/799395a76216442a6d63ea218c5495148309ded3528ee3229477104ac2bfaae5.txt",
      "sha256": "799395a76216442a6d63ea218c5495148309ded3528ee3229477104ac2bfaae5",
      "bytes": 9627,
      "redacted": false
    },
    {
      "name": "host-tests.log",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/host-tests.log",
      "originalSha256": "32b49f63884ec7db7c8ef2cb8092e880018f888373f88f9cb4fb18cca7dbb801",
      "href": "/os-evidence/7f27644cb43cf6bc116a2447cf45a498f561cae748d9cf30dfe313a7dacf695c.txt",
      "sha256": "7f27644cb43cf6bc116a2447cf45a498f561cae748d9cf30dfe313a7dacf695c",
      "bytes": 743,
      "redacted": true
    },
    {
      "name": "positive.log",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/positive.log",
      "originalSha256": "2ee246f308cac3ae2cf11d1977dc5a1383d521a73f4ab3cd7fb8b7d4fb19231e",
      "href": "/os-evidence/2ee246f308cac3ae2cf11d1977dc5a1383d521a73f4ab3cd7fb8b7d4fb19231e.txt",
      "sha256": "2ee246f308cac3ae2cf11d1977dc5a1383d521a73f4ab3cd7fb8b7d4fb19231e",
      "bytes": 416,
      "redacted": false
    },
    {
      "name": "negative.log",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/negative.log",
      "originalSha256": "aea2f35f4f95f1a8de5695883cbb1d0e53421c4cf79e224a27f13d76b1376b34",
      "href": "/os-evidence/aea2f35f4f95f1a8de5695883cbb1d0e53421c4cf79e224a27f13d76b1376b34.txt",
      "sha256": "aea2f35f4f95f1a8de5695883cbb1d0e53421c4cf79e224a27f13d76b1376b34",
      "bytes": 416,
      "redacted": false
    },
    {
      "name": "target.log",
      "source": "reports/os-implementation/K2165-update-slots-slots-staging-local-0sybeo/target.log",
      "originalSha256": "6b1fc15e406412db2d13efa10fa465a89f26a70fa5047e84798927ad33622d53",
      "href": "/os-evidence/e9007d0cdfa74103b143aa5e2cbb2b36cdfb24a52bd5b37681130a194b5fca60.txt",
      "sha256": "e9007d0cdfa74103b143aa5e2cbb2b36cdfb24a52bd5b37681130a194b5fca60",
      "bytes": 222,
      "redacted": true
    },
    {
      "name": "harness.mjs.txt",
      "source": "reports/os-implementation/K2165-update-slots-slots-local-yPvskU/harness.mjs.txt",
      "originalSha256": "afc913f79c414c44a72e26a3a004d9f03d04045996a9bd2887ce7c9410385284",
      "href": "/os-evidence/afc913f79c414c44a72e26a3a004d9f03d04045996a9bd2887ce7c9410385284.txt",
      "sha256": "afc913f79c414c44a72e26a3a004d9f03d04045996a9bd2887ce7c9410385284",
      "bytes": 4604,
      "redacted": false
    },
    {
      "name": "k2165-update-slots-slots.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-candidate-bNKwk5/sources/kernel/src/k2165-update-slots-slots.rs",
      "originalSha256": "69496c1c047c5268c1af818e6b1ee9a0dd12a5963f3c619dc21aa24e43f8827f",
      "href": "/os-evidence/69496c1c047c5268c1af818e6b1ee9a0dd12a5963f3c619dc21aa24e43f8827f.txt",
      "sha256": "69496c1c047c5268c1af818e6b1ee9a0dd12a5963f3c619dc21aa24e43f8827f",
      "bytes": 11934,
      "redacted": false
    },
    {
      "name": "update_slots_slots.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-candidate-bNKwk5/sources/kernel/src/runtime/update_slots_slots.rs",
      "originalSha256": "a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4",
      "href": "/os-evidence/a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4.txt",
      "sha256": "a8a54fcf05eb05538492c66c29420767f3e06e0307b29c704e2956895b3544b4",
      "bytes": 16882,
      "redacted": false
    },
    {
      "name": "main.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-candidate-bNKwk5/sources/kernel/src/main.rs",
      "originalSha256": "980063bef92dba24e5e1b2d881150f69272077189f65f2f93064d3e67a6eebb8",
      "href": "/os-evidence/e6d28aade42fb9d3759f613a1f0878a23590e28eeefa44be6f3365e141fcb29c.txt",
      "sha256": "e6d28aade42fb9d3759f613a1f0878a23590e28eeefa44be6f3365e141fcb29c",
      "bytes": 2307928,
      "redacted": true
    },
    {
      "name": "mod.rs",
      "source": "reports/os-implementation/K2165-update-slots-slots-candidate-bNKwk5/sources/kernel/src/runtime/mod.rs",
      "originalSha256": "bcdfb1f59f9bda0396fd29df99958fb9410d5f0a8ad9f01cc51a581ac0cf19eb",
      "href": "/os-evidence/bcdfb1f59f9bda0396fd29df99958fb9410d5f0a8ad9f01cc51a581ac0cf19eb.txt",
      "sha256": "bcdfb1f59f9bda0396fd29df99958fb9410d5f0a8ad9f01cc51a581ac0cf19eb",
      "bytes": 4326,
      "redacted": false
    },
    {
      "name": "kernel-product.log",
      "source": "reports/os-implementation/K2165-update-slots-slots-candidate-bNKwk5/kernel-product.log",
      "originalSha256": "3f5fcc746a9d76c2161d266370363d80543151ba96ea182193b1d89d180ce839",
      "href": "/os-evidence/c81b000844482804501e2e02fbf8fe9d0bf467dd890d20fb32810ff90e274b53.txt",
      "sha256": "c81b000844482804501e2e02fbf8fe9d0bf467dd890d20fb32810ff90e274b53",
      "bytes": 2295,
      "redacted": true
    }
  ],
  "moves": [
    "K2161",
    "K2162",
    "K2163",
    "K2164"
  ]
}
