{
  "kind": "original-bounded-choice-workflow",
  "version": 1,
  "scope": "Review object-level ownership scope for a caller-selected record in an authenticated handler.",
  "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
  "choices": [
    "Scoped",
    "Unscoped",
    "Public",
    "Unclear"
  ],
  "actions": {
    "Scoped": {
      "action": "preview_jev_record_ownership_scope",
      "payload": {
        "decision": "Scoped"
      },
      "pending": true
    },
    "Unscoped": {
      "action": "preview_jev_record_ownership_scope",
      "payload": {
        "decision": "Unscoped"
      },
      "pending": true
    },
    "Public": {
      "action": "preview_jev_record_ownership_scope",
      "payload": {
        "decision": "Public"
      },
      "pending": true
    },
    "Unclear": {
      "action": "preview_jev_record_ownership_scope",
      "payload": {
        "decision": "Unclear"
      },
      "pending": true
    }
  },
  "samples": [
    {
      "id": "case-1",
      "label": "Owner in query",
      "expected": "Scoped",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"const user=await requireSession(); return db.note.findFirst({where:{id:input.id,ownerId:user.id}});\",\n    \"context\": \"Notes are user-owned; session is verified\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-2",
      "label": "Signed in only",
      "expected": "Unscoped",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"const user=await requireSession(); return db.note.findUnique({where:{id:input.id}});\",\n    \"context\": \"Complete handler; user-owned notes; no RLS or downstream guard\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-3",
      "label": "Check before return",
      "expected": "Scoped",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"const n=await db.note.findUnique({where:{id}}); if(n.ownerId!==session.user.id)throw Error(\\\"Denied\\\"); return n;\",\n    \"context\": \"Verified server session; no earlier use\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-4",
      "label": "Published catalog",
      "expected": "Public",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"return db.product.findFirst({where:{id:input.id,published:true}});\",\n    \"context\": \"Published product records are public; no private fields in this projection\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-5",
      "label": "Unknown access helper",
      "expected": "Unclear",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"return getNoteForCurrentUser(input.id);\",\n    \"helper\": \"implementation unavailable\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-6",
      "label": "Wrong tenant source",
      "expected": "Unscoped",
      "request": {
        "context": "{\n  \"task\": \"Review object-level ownership scope for a caller-selected record in an authenticated handler.\",\n  \"evidence\": {\n    \"code\": \"return db.note.findFirst({where:{id:input.id,tenantId:input.tenantId}});\",\n    \"context\": \"Complete authenticated handler; tenantId is unverified input; no RLS\"\n  }\n}",
        "question": "For a caller-selected record: Scoped if a server-derived owner/tenant filter or explicit permission check applies before use; Unscoped if a user-owned record is used by ID without such a check in the complete code; Public if the supplied policy makes this record public. Use Unclear for omitted access helpers, row policies or resource ownership. Authentication alone is not object permission; do not infer a real exploit.",
        "choices": [
          "Scoped",
          "Unscoped",
          "Public",
          "Unclear"
        ]
      }
    }
  ],
  "consumer": "preview_choice_workflow.py"
}
