{
  "handle": "StateLock",
  "mechanism": "A coordination pattern where two {{actor}}s temporarily 'fuse' a subset of their writable {{state}}. During the {{lock}}, changes require a cryptographic signature from both. Contention triggers {{backoff}} and {{cooldown}}.",
  "gloss": "Atomic coordination via temporary state fusion",
  "failure_modes": [
    "Deadlock: both parties wait for each other indefinitely.",
    "Livelock: lock acquired and released rapidly, denying access to others.",
    "Premature dissolution: state auto-dissolves while legitimate work is in progress."
  ],
  "_meta": {
    "ring": 0,
    "tier": 1,
    "caution": "Exclusive state access — misuse enables denial of service via lock starvation.",
    "supersedes": [
      "sema:StateLock#mh:SHA-256:774b674f80993c49b0a348c384397f80027af319faa3440813d9d53b3eaa6a14",
      "sema:StateLock#mh:SHA-256:b91b68adbca94d80103e153ae63a987cbd7fb3a29463a5c8e6d88132b85cfa9a",
      "sema:StateLock#mh:SHA-256:7cd86a9de68522b752366ef04de32f743b57ef16232866522ccdafb1f35c6da9",
      "sema:StateLock#mh:SHA-256:8bde7c49752578e5c76e46d33b995497728f486d69d99ff618b9dbeaa7586c78"
    ],
    "path": [
      "Society",
      "Protocols"
    ]
  },
  "signature": [
    "Lock(State)"
  ],
  "sema_ref": "StateLock#c9c2",
  "sema_id": "sema:StateLock#mh:SHA-256:c9c2809bdf97bb6ac17a8ffe428d4aa9a28294b99d64cc8a336a239d26a8afb8",
  "sema_stub": "c9c2",
  "invariants": [
    "Both {{actor}}s sign every write to the fused {{state}} subset.",
    "Exclusive over that subset: no third party writes it while the {{lock}} holds.",
    "Temporary: the fusion ends on completion or timeout, never implicitly."
  ],
  "dependencies": {
    "composes_with": {
      "backoff": "sema:Backoff#mh:SHA-256:9e59718422f5408d7892feccb6d538a21103f9573b122b891ee3c8cf66303e72",
      "cooldown": "sema:Cooldown#mh:SHA-256:c288d88055cb0aae80c4b67ed62afcd3ebcc5de18749fc6efb15e9f8c529b9df"
    },
    "references": {
      "actor": "sema:Actor#mh:SHA-256:86fc0930b97ffb4fe85d4820af8e17a43166b745d181895f576edf39edde6aa8",
      "lock": "sema:Lock#mh:SHA-256:95c2ee952a5301d4b346a5e8693350829d88b3c600048eedcf87bb00c23ee5fb",
      "state": "sema:State#mh:SHA-256:4f25e6a16ccd37dc0bc154cccc7055cb504d49daa8b712f372a425eb6c7b8cb2"
    }
  },
  "sema_layer": "Society",
  "sema_category": "Protocols",
  "used_by": {
    "references": {
      "CausalBarrier": "sema:CausalBarrier#mh:SHA-256:cf54b35c9236d8fd2db3ca4f35ab5bdaac79c17052d9095aaa5fa6f143507809",
      "IdempotentWrite": "sema:IdempotentWrite#mh:SHA-256:7226e14f5caed42394b33c28989972451a03b43ba531e8cb6a9975a0fee4ab2c",
      "MonotonicCounter": "sema:MonotonicCounter#mh:SHA-256:d0d3ce256be4bc080a29eab7fda36381a4352a280d9a12d59179c60e71cf9bd0"
    },
    "composes_with": {
      "ContinuousResourceAuction": "sema:ContinuousResourceAuction#mh:SHA-256:c725833053eec6c59a6e1cc307abb8176a0efe407e512bf718cf0f1e60a66815"
    }
  }
}
