{
  "schema_version": 1,
  "title": "File-lock handoff: identity, freshness and output submission",
  "observed_date": "2026-11-30",
  "method": "Controlled native schedules, not random fault sampling",
  "scope": "One Linux 6.8.0-151-generic host; stdio uses glibc 2.39",
  "limitations": [
    "Not a field failure rate or a crash/power-loss experiment.",
    "Input cases have one writer; do not count them as lost updates.",
    "No NFS/SMB, lock-family migration or blocking-waiter fairness test.",
    "Compiler/Python modes share one host; not independent platforms."
  ],
  "article": "https://hesela.com/analyses/atomic-rename-directory-durability/#lock-handoff",
  "handoff": [
    {
      "mode": "retained-late-open",
      "label": "Retain lock file; open data after locking",
      "cases": 10,
      "final_value_counts": {
        "2": 10
      },
      "overlap_cases": 0,
      "acknowledged_increments": 20
    },
    {
      "mode": "unlink-after-unlock",
      "label": "Unlink lock file after unlock",
      "cases": 10,
      "final_value_counts": {
        "1": 10
      },
      "overlap_cases": 10,
      "acknowledged_increments": 20
    },
    {
      "mode": "retained-early-open",
      "label": "Open data before acquiring the lock",
      "cases": 10,
      "final_value_counts": {
        "1": 10
      },
      "overlap_cases": 0,
      "acknowledged_increments": 20
    },
    {
      "mode": "retained-reopen",
      "label": "Reopen data after acquiring the lock",
      "cases": 10,
      "final_value_counts": {
        "2": 10
      },
      "overlap_cases": 0,
      "acknowledged_increments": 20
    }
  ],
  "stdio": [
    {
      "mode": "input-retain",
      "label": "Retain input stream",
      "cases": 6,
      "observed_values": [
        0
      ],
      "writer_reads": [
        0
      ],
      "final_values": [
        1
      ]
    },
    {
      "mode": "input-seek",
      "label": "Seek inside retained input buffer",
      "cases": 6,
      "observed_values": [
        0
      ],
      "writer_reads": [
        0
      ],
      "final_values": [
        1
      ]
    },
    {
      "mode": "input-flush",
      "label": "Clean seekable input with fflush",
      "cases": 6,
      "observed_values": [
        1
      ],
      "writer_reads": [
        0
      ],
      "final_values": [
        1
      ]
    },
    {
      "mode": "input-reopen",
      "label": "Reopen and position input under lock",
      "cases": 6,
      "observed_values": [
        1
      ],
      "writer_reads": [
        0
      ],
      "final_values": [
        1
      ]
    },
    {
      "mode": "output-late",
      "label": "Flush output after lock handoff",
      "cases": 6,
      "observed_values": [],
      "writer_reads": [
        0
      ],
      "final_values": [
        1
      ]
    },
    {
      "mode": "output-early",
      "label": "Flush output before unlock",
      "cases": 6,
      "observed_values": [],
      "writer_reads": [
        1
      ],
      "final_values": [
        2
      ]
    }
  ],
  "artifacts": [
    {
      "url": "https://hesela.dev/research/lock-handoff/LICENSE",
      "sha256": "76f766c37bcef4437e98066c0611c55b4bac87cda60491ecc47b90ab42df0885",
      "bytes": 1076
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/observe.py",
      "sha256": "3c293d402989cd15678c88dd8903a7b0a2473b40c39bda290bf83bf048e99ddc",
      "bytes": 11332
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/test_observe.py",
      "sha256": "3e052a00d3c0105d49104b01ecaf2f32078988fbafd8ffd9dae7e4c84861cc90",
      "bytes": 5885
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/test_verify.py",
      "sha256": "73d9274c419f20783152cca798ca979dc5bb5ca6a41ea06d5f6b4d29431c7e14",
      "bytes": 2291
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/verify.py",
      "sha256": "92ca2eeeb813f90070b774d0525dc8ed8858a948321744842bfa36b71fdfd1a3",
      "bytes": 2886
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/observations-normal.json",
      "sha256": "f3cc42df0997ef5b1a9b7706fb2d2aba3abea39744eeca9322ff4269c58c966f",
      "bytes": 100629
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/observations-optimized.json",
      "sha256": "3d96f030cae80e781068880bbba7fdb637f203c5d1651c36bb49387b457dc861",
      "bytes": 100629
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/summary.json",
      "sha256": "69c3e8644b32ee9ea94cb87d28efaaa660a3885e81a641821f7494eb5830bec9",
      "bytes": 1962
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/sources.json",
      "sha256": "ca5276d88e937b0f287961d3f9ae937362492bf30ce50587cf9e99909686d494",
      "bytes": 2371
    },
    {
      "url": "https://hesela.dev/research/lock-handoff/source-receipts.json",
      "sha256": "a09c7264a847a7bcdb5daa46e8eee80d674c9fc7f1016a80854808dc8f3de78f",
      "bytes": 2341
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/LICENSE",
      "sha256": "76f766c37bcef4437e98066c0611c55b4bac87cda60491ecc47b90ab42df0885",
      "bytes": 1076
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/probe.c",
      "sha256": "b367cb461c6dfde72f7656e2e13adc5bf8abf854b9cae8dc09d95e827f4a5f2b",
      "bytes": 4101
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/run.py",
      "sha256": "9b2ead46f64cfccf417c10b3927f721e766988f948e94ef7fb16cc7c8df8d46c",
      "bytes": 12832
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/test_run.py",
      "sha256": "565c0a23b54025c8a3a66c29c687e868405a9dc811252d0db42acd7d137e8a3a",
      "bytes": 4200
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/validate.py",
      "sha256": "b6fd67966f2ee10abb9c3ea0234902569afde73ac03b10b19da6a7d932c1cf3c",
      "bytes": 1922
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/observations.json",
      "sha256": "ed0cb53133c0817d907e369bda14944153eb5756bc52f82185cccb2d6816179f",
      "bytes": 116180
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/summary.json",
      "sha256": "b326331130d0844bb2d53244f2e818f9217161c7d9d847c60a7be3f93397612b",
      "bytes": 897
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/sources.json",
      "sha256": "68db666b7c9b684b2386466c3da83e6833a93699ea417bae19e87bc4978f3822",
      "bytes": 3684
    },
    {
      "url": "https://hesela.dev/research/stdio-lock-boundary/source-receipts.json",
      "sha256": "70fd281caca1924657fb0aff985b0c7ee4fcffd2bb95a8deefc05afa82fbf879",
      "bytes": 3600
    }
  ]
}
