[
  {
    "schema_version": "workflow-task/v1",
    "sample_kind": "public_sample",
    "task_id": "workflow-csv-quality",
    "version": "1.0.0",
    "vertical_id": "data_operations",
    "title": "Audit a CSV pipeline against control totals",
    "instructions": "Prepare quality-report.json from events.csv, accounts.csv, control.json and contract.md. Apply the declared processing order, join regions, calculate region and grand totals, classify rejected rows, and compare both controls. Use integer USD cents. Sort region rows by region and all diagnostic IDs alphabetically. This is a public sample workflow, not measured model or production reliability evidence.",
    "steps": [
      "Read the processing contract and source files.",
      "Deduplicate event IDs and apply exclusions in contract order.",
      "Join accounts, aggregate valid posted events by region.",
      "Compare amount and count controls and write the report."
    ],
    "inputs": [
      {
        "path": "inputs/events.csv",
        "content": "event_id,account_id,amount_cents,status\nE01,A1,1000,posted\nE02,A1,2500,posted\nE02,A1,2500,posted\nE03,A2,6000,posted\nE04,A2,-500,posted\nE05,A3,4000,pending\nE06,A9,7000,posted\nE07,A2,not-a-number,posted\nE08,A3,2000,posted\n"
      },
      {
        "path": "inputs/accounts.csv",
        "content": "account_id,region\nA1,west\nA2,east\nA3,west\n"
      },
      {
        "path": "inputs/control.json",
        "content": "{\"expected_posted_valid_total_cents\":11000,\"expected_valid_unique_event_count\":5}\n"
      },
      {
        "path": "inputs/contract.md",
        "content": "# Reconciliation contract v1\nProcess events in source order. Deduplicate by event_id, keeping the first occurrence.\nThen exclude non-posted events, unknown accounts and non-integer amounts, in that order.\nNegative integer amounts are valid posted adjustments. Join region from accounts.csv.\nReport every known region, in alphabetical order. For each region report sum of valid\nposted amounts and count of valid unique events. Compare total and count with control.json.\nAll diagnostic ID lists must be alphabetical. Reconciliation passes only when both\ncontrol totals agree. Preserve sources; emit only the requested report artifact.\n"
      }
    ],
    "output_artifact": "quality-report.json",
    "output_schema": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "regions",
        "total_cents",
        "valid_unique_event_count",
        "duplicate_event_ids",
        "non_posted_event_ids",
        "unknown_account_event_ids",
        "invalid_amount_event_ids",
        "amount_control_matches",
        "count_control_matches",
        "reconciliation_passes"
      ],
      "properties": {
        "regions": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "region",
              "amount_cents",
              "event_count"
            ],
            "properties": {
              "region": {
                "type": "string"
              },
              "amount_cents": {
                "type": "integer"
              },
              "event_count": {
                "type": "integer"
              }
            }
          }
        },
        "total_cents": {
          "type": "integer"
        },
        "valid_unique_event_count": {
          "type": "integer"
        },
        "duplicate_event_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "non_posted_event_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unknown_account_event_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "invalid_amount_event_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "amount_control_matches": {
          "type": "boolean"
        },
        "count_control_matches": {
          "type": "boolean"
        },
        "reconciliation_passes": {
          "type": "boolean"
        }
      }
    },
    "grader_version": "structured-exact/v1",
    "ideal_output_json": "{\n  \"regions\": [\n    {\n      \"region\": \"east\",\n      \"amount_cents\": 5500,\n      \"event_count\": 2\n    },\n    {\n      \"region\": \"west\",\n      \"amount_cents\": 5500,\n      \"event_count\": 3\n    }\n  ],\n  \"total_cents\": 11000,\n  \"valid_unique_event_count\": 5,\n  \"duplicate_event_ids\": [\n    \"E02\"\n  ],\n  \"non_posted_event_ids\": [\n    \"E05\"\n  ],\n  \"unknown_account_event_ids\": [\n    \"E06\"\n  ],\n  \"invalid_amount_event_ids\": [\n    \"E07\"\n  ],\n  \"amount_control_matches\": true,\n  \"count_control_matches\": true,\n  \"reconciliation_passes\": true\n}\n",
    "near_miss_output_json": "{\n  \"regions\": [\n    {\n      \"region\": \"east\",\n      \"amount_cents\": 5500,\n      \"event_count\": 2\n    },\n    {\n      \"region\": \"west\",\n      \"amount_cents\": 5500,\n      \"event_count\": 3\n    }\n  ],\n  \"total_cents\": 11500,\n  \"valid_unique_event_count\": 5,\n  \"duplicate_event_ids\": [\n    \"E02\"\n  ],\n  \"non_posted_event_ids\": [\n    \"E05\"\n  ],\n  \"unknown_account_event_ids\": [\n    \"E06\"\n  ],\n  \"invalid_amount_event_ids\": [\n    \"E07\"\n  ],\n  \"amount_control_matches\": true,\n  \"count_control_matches\": true,\n  \"reconciliation_passes\": true\n}\n"
  },
  {
    "schema_version": "workflow-task/v1",
    "sample_kind": "public_sample",
    "task_id": "workflow-invoice-reconciliation",
    "version": "1.0.0",
    "vertical_id": "finance",
    "title": "Reconcile invoices, settlements and credits",
    "instructions": "Prepare reconciliation.json from the four input files. Read the ledger policy, reconcile each invoice, and explain excluded and duplicate events through the declared diagnostic fields. Use integer USD cents. Include fully paid invoices. Sort invoice rows by invoice_id and diagnostic IDs alphabetically. This is a public sample workflow, not a production account or measured model result.",
    "steps": [
      "Read the invoice ledger and policy.",
      "Deduplicate payments, then apply status eligibility.",
      "Join approved credits and compute every invoice balance.",
      "Reconcile totals and write the final artifact."
    ],
    "inputs": [
      {
        "path": "inputs/invoices.csv",
        "content": "invoice_id,customer_id,amount_cents\nI101,C17,120000\nI102,C17,80000\nI103,C23,45000\n"
      },
      {
        "path": "inputs/payments.csv",
        "content": "payment_id,invoice_id,amount_cents,status\nP01,I101,120000,settled\nP02,I102,50000,settled\nP01,I101,120000,settled\nP03,I103,45000,reversed\nP04,I103,20000,settled\n"
      },
      {
        "path": "inputs/credits.csv",
        "content": "credit_id,invoice_id,amount_cents,status\nC01,I102,15000,approved\nC02,I103,5000,pending\n"
      },
      {
        "path": "inputs/rules.md",
        "content": "# Ledger policy v1\nAll amounts are USD cents. Count only settled payments and approved credits.\nRepeated rows carrying the same payment_id are one event; count the first occurrence.\nA reversed payment contributes zero. A pending credit contributes zero.\nOpen balance = original invoice - counted payments - counted credits.\nDo not net different invoices or omit fully settled invoices.\nThe report must list invoices by invoice_id and all diagnostic IDs alphabetically.\n"
      }
    ],
    "output_artifact": "reconciliation.json",
    "output_schema": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "invoices",
        "total_open_cents",
        "duplicate_payment_ids",
        "excluded_payment_ids",
        "excluded_credit_ids"
      ],
      "properties": {
        "invoices": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "invoice_id",
              "open_balance_cents"
            ],
            "properties": {
              "invoice_id": {
                "type": "string"
              },
              "open_balance_cents": {
                "type": "integer"
              }
            }
          }
        },
        "total_open_cents": {
          "type": "integer"
        },
        "duplicate_payment_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excluded_payment_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excluded_credit_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "grader_version": "structured-exact/v1",
    "ideal_output_json": "{\n  \"invoices\": [\n    {\n      \"invoice_id\": \"I101\",\n      \"open_balance_cents\": 0\n    },\n    {\n      \"invoice_id\": \"I102\",\n      \"open_balance_cents\": 15000\n    },\n    {\n      \"invoice_id\": \"I103\",\n      \"open_balance_cents\": 25000\n    }\n  ],\n  \"total_open_cents\": 40000,\n  \"duplicate_payment_ids\": [\n    \"P01\"\n  ],\n  \"excluded_payment_ids\": [\n    \"P03\"\n  ],\n  \"excluded_credit_ids\": [\n    \"C02\"\n  ]\n}\n",
    "near_miss_output_json": "{\n  \"invoices\": [\n    {\n      \"invoice_id\": \"I101\",\n      \"open_balance_cents\": 0\n    },\n    {\n      \"invoice_id\": \"I102\",\n      \"open_balance_cents\": 15000\n    },\n    {\n      \"invoice_id\": \"I103\",\n      \"open_balance_cents\": 25000\n    }\n  ],\n  \"total_open_cents\": 35000,\n  \"duplicate_payment_ids\": [\n    \"P01\"\n  ],\n  \"excluded_payment_ids\": [\n    \"P03\"\n  ],\n  \"excluded_credit_ids\": [\n    \"C02\"\n  ]\n}\n"
  },
  {
    "schema_version": "workflow-task/v1",
    "sample_kind": "public_sample",
    "task_id": "workflow-support-resolution",
    "version": "1.0.0",
    "vertical_id": "customer_service",
    "title": "Resolve a defect exception without a duplicate refund",
    "instructions": "Prepare decision.json from the order, ticket, stock, refund history and policy. Calculate calendar days since delivery, choose the policy route, and calculate the new refund without repaying prior refunds. Use integer USD cents and list evidence paths alphabetically. This is a draft decision artifact only: do not issue a refund or send a message. This is a public sample workflow, not measured model evidence.",
    "steps": [
      "Read the ticket and verify the order and evidence.",
      "Apply ordinary return and defect-exception windows.",
      "Check stock and subtract previously settled refunds.",
      "Check escalation threshold and prepare the decision artifact."
    ],
    "inputs": [
      {
        "path": "inputs/order.json",
        "content": "{\"order_id\":\"O734\",\"delivered_on\":\"2026-10-01\",\"item_id\":\"HS4\",\"item_price_cents\":26000,\"item_discount_cents\":2000,\"standard_shipping_cents\":1200,\"expedited_surcharge_cents\":600,\"receipt_verified\":true}\n"
      },
      {
        "path": "inputs/ticket.json",
        "content": "{\"ticket_id\":\"T91\",\"order_id\":\"O734\",\"received_on\":\"2026-11-01\",\"issue\":\"verified manufacturing defect: cracked headset shell\",\"defect_verified\":true,\"customer_request\":\"Please refund my full 25800 cents.\"}\n"
      },
      {
        "path": "inputs/inventory.csv",
        "content": "item_id,replacement_stock\nHS4,0\n"
      },
      {
        "path": "inputs/refunds.csv",
        "content": "refund_id,order_id,component,amount_cents,status\nR17,O734,standard_shipping,1200,settled\n"
      },
      {
        "path": "inputs/policy.md",
        "content": "# Sample support policy v1 (effective 2026-09-01)\nOrdinary discretionary returns are eligible for 30 calendar days after delivery.\nA verified manufacturing defect reported within 60 calendar days after delivery has\nan exception: offer a replacement if stock exists; otherwise prepare a refund.\nThe refundable item amount is price less item discount. Standard outbound shipping\nis refundable on a defect. Expedited surcharges are never refundable.\nSubtract any settled prior refund for each component so it is not paid twice.\nA new refund above 25000 cents requires supervisor escalation. Receipt verification\nand defect verification are required; if either is missing, escalate instead.\nPrepare the decision only. No live refund, customer message or inventory change is authorized.\nList evidence file paths alphabetically. Days since delivery is ordinary date subtraction.\n"
      }
    ],
    "output_artifact": "decision.json",
    "output_schema": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ticket_id",
        "order_id",
        "days_since_delivery",
        "policy_route",
        "resolution",
        "new_refund_cents",
        "prior_refund_cents",
        "nonrefundable_expedite_cents",
        "requires_escalation",
        "action",
        "evidence"
      ],
      "properties": {
        "ticket_id": {
          "type": "string"
        },
        "order_id": {
          "type": "string"
        },
        "days_since_delivery": {
          "type": "integer"
        },
        "policy_route": {
          "type": "string",
          "enum": [
            "ordinary_return",
            "defect_exception",
            "escalation"
          ]
        },
        "resolution": {
          "type": "string",
          "enum": [
            "refund",
            "replacement",
            "escalate"
          ]
        },
        "new_refund_cents": {
          "type": "integer"
        },
        "prior_refund_cents": {
          "type": "integer"
        },
        "nonrefundable_expedite_cents": {
          "type": "integer"
        },
        "requires_escalation": {
          "type": "boolean"
        },
        "action": {
          "type": "string",
          "const": "draft_only"
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "grader_version": "structured-exact/v1",
    "ideal_output_json": "{\n  \"ticket_id\": \"T91\",\n  \"order_id\": \"O734\",\n  \"days_since_delivery\": 31,\n  \"policy_route\": \"defect_exception\",\n  \"resolution\": \"refund\",\n  \"new_refund_cents\": 24000,\n  \"prior_refund_cents\": 1200,\n  \"nonrefundable_expedite_cents\": 600,\n  \"requires_escalation\": false,\n  \"action\": \"draft_only\",\n  \"evidence\": [\n    \"inputs/inventory.csv\",\n    \"inputs/order.json\",\n    \"inputs/policy.md\",\n    \"inputs/refunds.csv\",\n    \"inputs/ticket.json\"\n  ]\n}\n",
    "near_miss_output_json": "{\n  \"ticket_id\": \"T91\",\n  \"order_id\": \"O734\",\n  \"days_since_delivery\": 31,\n  \"policy_route\": \"defect_exception\",\n  \"resolution\": \"refund\",\n  \"new_refund_cents\": 25200,\n  \"prior_refund_cents\": 1200,\n  \"nonrefundable_expedite_cents\": 600,\n  \"requires_escalation\": false,\n  \"action\": \"draft_only\",\n  \"evidence\": [\n    \"inputs/inventory.csv\",\n    \"inputs/order.json\",\n    \"inputs/policy.md\",\n    \"inputs/refunds.csv\",\n    \"inputs/ticket.json\"\n  ]\n}\n"
  }
]
