6. Execute the daytime flow, pinned

After approval, execute the exact validated program with the exact token returned by validation:

Request
{
  "tool": "run_flow",
  "arguments": {
    "flow": {
      "name": "open Harborview for the day",
      "steps": [
        {
          "id": "lobby-on",
          "do": "call",
          "device": "light.lobby",
          "action": "turn_on"
        },
        {
          "id": "dock-unlock",
          "do": "call",
          "device": "lock.dock_door",
          "action": "unlock"
        }
      ]
    },
    "mode": "immediate",
    "expected_catalog_version": "cv_590fefad56a7a504",
    "trace_level": "full",
    "idempotency_key": "tutorial-open-day-v1"
  }
}
Response
{
  "run_id": "run_0001",
  "outcome": {
    "ok": true,
    "status": "success",
    "error": null
  },
  "trace": {
    "run_id": "run_0001",
    "level": "full",
    "steps": [
      {
        "id": "lobby-on",
        "calls": "light.lobby",
        "input": {
          "action": "turn_on"
        },
        "output": {
          "on": true,
          "brightness": 100
        },
        "outcome": {
          "ok": true,
          "status": "success",
          "error": null
        }
      },
      {
        "id": "dock-unlock",
        "calls": "lock.dock_door",
        "input": {
          "action": "unlock"
        },
        "output": {
          "locked": false
        },
        "outcome": {
          "ok": true,
          "status": "success",
          "error": null
        }
      }
    ]
  }
}

The trace should then be checked against the work order:

  • Is lobby-on present?
  • Does its calls value equal light.lobby?
  • Is dock-unlock present?
  • Does its calls value equal lock.dock_door?
  • Did both step outcomes report success?

Do not stop at the run-level word success; mission verification checks the trace envelope against the requested job. Verification is the agent's own activity, done with the trace in hand; it is not a layer the server provides. A control-flow decision appears in Chapter 8, when the installed alarm's branch fires.

What this taught

Pinning protects the gap between validation and execution. A trace is evidence of reached behavior, including control-flow decisions.

See Execution, traces, and decisions and Part II ยง6.5.