{
  "endpoint": "POST /v0/phase/return-sleep-decisions",
  "environment": "local",
  "timezone": "America/New_York",
  "initial": {
    "request": {
      "metadata": {
        "request_id": "initial",
        "subject_id": "fictional-traveler",
        "source_refs": [
          {
            "source_id": "fixture",
            "source_url": "synthetic://wake-comparison",
            "retrieved_at": "2026-12-05T17:00:00Z"
          }
        ]
      },
      "timezone_and_trip": {
        "arrival_local_time": "2026-12-05T11:30:00-05:00",
        "trip_state": "COMPLETED"
      },
      "plan_update_context": {
        "as_of": "2026-12-05T12:00:00-05:00",
        "trigger": "INITIAL",
        "input_snapshot_id": "snapshot-1"
      },
      "sleep_observation_window": {
        "start_at": "2026-12-04T17:00:00Z",
        "end_at": "2026-12-05T17:00:00Z",
        "coverage_complete": true,
        "max_age_minutes": 120
      },
      "observed_sleep_sessions": [
        {
          "record_id": "flight-sleep",
          "source_id": "fixture",
          "start_at": "2026-12-05T08:00:00Z",
          "end_at": "2026-12-05T15:00:00Z",
          "retrieved_at": "2026-12-05T17:00:00Z",
          "sleep_minutes": 420,
          "record_state": "ACTIVE"
        }
      ],
      "hard_constraints": {
        "calendar_checked_at": "2026-12-05T17:00:00Z",
        "coverage_complete": true,
        "coverage_start_at": "2026-12-05T12:00:00-05:00",
        "coverage_end_at": "2026-12-06T09:00:00-05:00",
        "locked_obligations": [
          {
            "label": "airport-transfer",
            "start_local": "2026-12-05T11:30:00-05:00",
            "end_local": "2026-12-05T15:00:00-05:00"
          }
        ],
        "controllable_windows": [
          {
            "start_at": "2026-12-05T12:00:00-05:00",
            "end_at": "2026-12-06T07:00:00-05:00"
          }
        ]
      },
      "planning_policy": {
        "sleep_goal_minutes": 420,
        "nap_duration_minutes": 30,
        "minimum_main_sleep_minutes": 360,
        "target_sleep_window": {
          "start_at": "2026-12-05T23:00:00-05:00",
          "end_at": "2026-12-06T07:00:00-05:00"
        }
      }
    },
    "response": {
      "status": "success",
      "metadata": {
        "request_id": "initial",
        "implementation": "local-feasibility-v1",
        "medical_or_circadian_prediction": false,
        "evaluation_mode": "LIVE",
        "hindsight_replay": false
      },
      "candidate_windows": [
        {
          "kind": "MAIN_SLEEP",
          "start_at": "2026-12-06T04:00:00Z",
          "end_at": "2026-12-06T12:00:00Z",
          "reason": "Fits caller target window and fixed obligations"
        }
      ],
      "evaluation_context": {
        "observed_sleep_minutes": 420,
        "sleep_gap_to_caller_goal_minutes": 0,
        "sleep_goal_scope": "caller-defined observation window",
        "source_refs": [
          {
            "source_id": "fixture",
            "source_url": "synthetic://wake-comparison",
            "retrieved_at": "2026-12-05T17:00:00Z"
          }
        ]
      },
      "plan_update": {
        "decision_id": "phase_a6d2cedbc0e139e507592a44",
        "evaluated_at": "2026-12-05T17:00:00Z",
        "input_snapshot_id": "snapshot-1",
        "previous_decision_id": null,
        "outcome": "INITIAL",
        "change_reasons": [
          "INITIAL_EVALUATION"
        ],
        "missing_inputs": [],
        "excluded_obligation_refs": [
          "airport-transfer"
        ]
      },
      "limitations": [
        "Feasibility only: sleep goal, target window and nap duration are caller choices.",
        "No predicted alertness, jet-lag benefit, optimal sleep time, or risk probabilities."
      ]
    }
  },
  "corrected": {
    "request": {
      "metadata": {
        "request_id": "corrected",
        "subject_id": "fictional-traveler",
        "source_refs": [
          {
            "source_id": "fixture",
            "source_url": "synthetic://wake-comparison",
            "retrieved_at": "2026-12-05T17:00:00Z"
          }
        ]
      },
      "timezone_and_trip": {
        "arrival_local_time": "2026-12-05T11:30:00-05:00",
        "trip_state": "COMPLETED"
      },
      "plan_update_context": {
        "as_of": "2026-12-05T12:00:00-05:00",
        "trigger": "SOURCE_CORRECTED",
        "input_snapshot_id": "snapshot-2",
        "previous_decision_id": "phase_a6d2cedbc0e139e507592a44"
      },
      "sleep_observation_window": {
        "start_at": "2026-12-04T17:00:00Z",
        "end_at": "2026-12-05T17:00:00Z",
        "coverage_complete": true,
        "max_age_minutes": 120
      },
      "observed_sleep_sessions": [
        {
          "record_id": "flight-sleep",
          "source_id": "fixture",
          "start_at": "2026-12-05T08:00:00Z",
          "end_at": "2026-12-05T12:00:00Z",
          "retrieved_at": "2026-12-05T17:00:00Z",
          "sleep_minutes": 240,
          "record_state": "ACTIVE"
        }
      ],
      "hard_constraints": {
        "calendar_checked_at": "2026-12-05T17:00:00Z",
        "coverage_complete": true,
        "coverage_start_at": "2026-12-05T12:00:00-05:00",
        "coverage_end_at": "2026-12-06T09:00:00-05:00",
        "locked_obligations": [
          {
            "label": "airport-transfer",
            "start_local": "2026-12-05T11:30:00-05:00",
            "end_local": "2026-12-05T15:00:00-05:00"
          }
        ],
        "controllable_windows": [
          {
            "start_at": "2026-12-05T12:00:00-05:00",
            "end_at": "2026-12-06T07:00:00-05:00"
          }
        ]
      },
      "planning_policy": {
        "sleep_goal_minutes": 420,
        "nap_duration_minutes": 30,
        "minimum_main_sleep_minutes": 360,
        "target_sleep_window": {
          "start_at": "2026-12-05T23:00:00-05:00",
          "end_at": "2026-12-06T07:00:00-05:00"
        }
      }
    },
    "response": {
      "status": "success",
      "metadata": {
        "request_id": "corrected",
        "implementation": "local-feasibility-v1",
        "medical_or_circadian_prediction": false,
        "evaluation_mode": "LIVE",
        "hindsight_replay": false
      },
      "candidate_windows": [
        {
          "kind": "MAIN_SLEEP",
          "start_at": "2026-12-06T04:00:00Z",
          "end_at": "2026-12-06T12:00:00Z",
          "reason": "Fits caller target window and fixed obligations"
        },
        {
          "kind": "OPTIONAL_REST",
          "start_at": "2026-12-05T20:00:00Z",
          "end_at": "2026-12-05T20:30:00Z",
          "reason": "Observed sleep below caller goal; optional rest fits availability, not a circadian recommendation"
        }
      ],
      "evaluation_context": {
        "observed_sleep_minutes": 240,
        "sleep_gap_to_caller_goal_minutes": 180,
        "sleep_goal_scope": "caller-defined observation window",
        "source_refs": [
          {
            "source_id": "fixture",
            "source_url": "synthetic://wake-comparison",
            "retrieved_at": "2026-12-05T17:00:00Z"
          }
        ]
      },
      "plan_update": {
        "decision_id": "phase_23c038bf96dcf6ad7da5500b",
        "evaluated_at": "2026-12-05T17:00:00Z",
        "input_snapshot_id": "snapshot-2",
        "previous_decision_id": "phase_a6d2cedbc0e139e507592a44",
        "outcome": "UPDATED",
        "change_reasons": [
          "SLEEP_CHANGED"
        ],
        "missing_inputs": [],
        "excluded_obligation_refs": [
          "airport-transfer"
        ]
      },
      "limitations": [
        "Feasibility only: sleep goal, target window and nap duration are caller choices.",
        "No predicted alertness, jet-lag benefit, optimal sleep time, or risk probabilities."
      ]
    }
  }
}
