{
  "id": "workflows",
  "number": "06",
  "label": "Multi-step file workflows",
  "formats": "Tool results · logs · saved files",
  "title": "Repair the job without repeating completed work.",
  "summary": "One export fails after other steps have succeeded. Recovery must preserve completed work and truthful status.",
  "status": "Constructed scenario",
  "source_note": "An original simulated local job and tool log. No external tool is called, no email is sent and no infrastructure failure is reproduced.",
  "sources": [],
  "attribution": "Original Tesserva demonstration. The job, file identifiers, tool events and recovery policy are invented.",
  "input": "Job J17 has fetched and normalized two records and saved report.json. A CSV export fails before writing anything. An old status file incorrectly says the whole job is complete.",
  "change": "A supplied tool log confirms that only the export failed. The recovery policy permits one retry of that step; it does not permit repeating successful steps or sending a delivery notice.",
  "task": "Repair job_status.json and export_rows.json after the supplied successful export retry. Preserve report.json byte-for-byte, retain one fetch and one normalization, record two export attempts, and leave delivery unsent. The task is offline; use the given log rather than calling a service.",
  "result": "The export contains the two normalized records. Only export is retried, the saved report is preserved, status becomes complete after retry success, and delivery remains unsent.",
  "checks": [
    "Successful fetch and normalization are not repeated.",
    "Exactly two export attempts are recorded.",
    "The report is preserved byte-for-byte.",
    "Completion follows the successful export result; delivery stays unsent."
  ],
  "inputs": {
    "job_id": "J17",
    "normalized_rows": [
      {
        "id": "R1",
        "value": 10
      },
      {
        "id": "R2",
        "value": 20
      }
    ],
    "tool_log": [
      {
        "step": "fetch",
        "attempt": 1,
        "status": "succeeded"
      },
      {
        "step": "normalize",
        "attempt": 1,
        "status": "succeeded"
      },
      {
        "step": "report",
        "attempt": 1,
        "status": "succeeded"
      },
      {
        "step": "export",
        "attempt": 1,
        "status": "failed_before_write"
      }
    ],
    "protected_files": [
      "report.json"
    ]
  },
  "update": {
    "retry_policy": "Retry export once only. Do not send a delivery notice.",
    "retry_result": {
      "step": "export",
      "attempt": 2,
      "status": "succeeded"
    }
  },
  "prior_outputs": {
    "report.json": {
      "job_id": "J17",
      "record_count": 2,
      "total": 30
    },
    "export_rows.json": [],
    "job_status.json": {
      "job_id": "J17",
      "fetch_attempts": 1,
      "normalize_attempts": 1,
      "export_attempts": 1,
      "status": "complete",
      "delivery_sent": false
    }
  },
  "expected_outputs": {
    "report.json": {
      "job_id": "J17",
      "record_count": 2,
      "total": 30
    },
    "export_rows.json": [
      {
        "id": "R1",
        "value": 10
      },
      {
        "id": "R2",
        "value": 20
      }
    ],
    "job_status.json": {
      "job_id": "J17",
      "fetch_attempts": 1,
      "normalize_attempts": 1,
      "export_attempts": 2,
      "status": "complete",
      "delivery_sent": false
    }
  }
}
