{
  "kind": "original-bounded-choice-workflow",
  "version": 1,
  "scope": "Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.",
  "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
  "choices": [
    "Unprotected",
    "Protected",
    "No shared update",
    "Review"
  ],
  "actions": {
    "Unprotected": {
      "action": "preview_jev_lost_update_review",
      "payload": {
        "decision": "Unprotected"
      },
      "pending": true
    },
    "Protected": {
      "action": "preview_jev_lost_update_review",
      "payload": {
        "decision": "Protected"
      },
      "pending": true
    },
    "No shared update": {
      "action": "preview_jev_lost_update_review",
      "payload": {
        "decision": "No shared update"
      },
      "pending": true
    },
    "Review": {
      "action": "preview_jev_lost_update_review",
      "payload": {
        "decision": "Review"
      },
      "pending": true
    }
  },
  "samples": [
    {
      "id": "case-1",
      "label": "Stale counter save",
      "expected": "Unprotected",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Read shared count, add one in application code, save that computed value.\",\n    \"concurrency\": \"Two callers may overlap.\",\n    \"protection\": \"Complete contract states no lock, atomic expression or version check.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    },
    {
      "id": "case-2",
      "label": "Atomic database expression",
      "expected": "Protected",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Database executes count = count + 1 as one atomic update.\",\n    \"concurrency\": \"Callers may overlap.\",\n    \"protection\": \"The database applies the expression atomically to the current stored value.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    },
    {
      "id": "case-3",
      "label": "Version check with conflict handling",
      "expected": "Protected",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Read value and version; save only if stored version still matches.\",\n    \"concurrency\": \"Callers may overlap.\",\n    \"protection\": \"A mismatch rejects the save and triggers explicit retry or conflict handling.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    },
    {
      "id": "case-4",
      "label": "Effective row lock",
      "expected": "Protected",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Lock the row, read, modify and save before releasing the same transaction lock.\",\n    \"concurrency\": \"Other writers honor the database lock.\",\n    \"protection\": \"The supplied lock excludes concurrent updates through commit.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    },
    {
      "id": "case-5",
      "label": "Local draft object",
      "expected": "No shared update",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Increment a counter on a new per-request object that is never shared or persisted.\",\n    \"concurrency\": \"Each request owns a separate object.\",\n    \"protection\": \"No shared stored update occurs.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    },
    {
      "id": "case-6",
      "label": "Unknown isolation guarantee",
      "expected": "Review",
      "request": {
        "context": "{\n  \"task\": \"Classify a supplied shared-state update path by whether read-modify-write protection is explicit, absent or unknown.\",\n  \"evidence\": {\n    \"path\": \"Read a value, modify locally and save inside a transaction.\",\n    \"concurrency\": \"Overlap is possible.\",\n    \"protection\": \"Isolation level, locks and version behavior are not supplied.\"\n  }\n}",
        "question": "Review the complete update path. Unprotected means overlapping callers read a shared stored value, modify it locally and save without an atomic update, effective row lock or checked version guard. Protected means the supplied contract establishes such protection. No shared update means only a local/new object changes or no stored update occurs. Review takes precedence for missing/conflicting concurrency or protection facts. A transaction alone is not proof; do not simulate balances.",
        "choices": [
          "Unprotected",
          "Protected",
          "No shared update",
          "Review"
        ]
      }
    }
  ],
  "consumer": "preview_choice_workflow.py"
}
