Skip to content

Automate browser based workflows with AI

8.4 KB
Raw Blame
{
  "provenance": {
    "kind": "branch_local_witness",
    "source": "derived from captured_repair_then_completed_run.json",
    "notes": "The capture's two failed runs, then a draft that also gained an unrelated second block; the later run passed but executed only that second block, not the one that failed. The last step is authored, not captured. Each failed run's outcome lists its failed block in failed_block_labels, as the recorder sets it."
  },
  "steps": [
    {
      "workflow_yaml": "title: Retrieve deferred freight quote total\nworkflow_definition:\n  parameters: []\n  blocks:\n    - block_type: code\n      label: calculate_and_extract_quote_total\n      prompt: Open quote QF-4821, calculate its shipping-inclusive order total, and return the page-displayed total as a number.\n      code: |\n        await page.goto(\"http://localhost:8900/deferred_total_quote/\")\n        quote_heading = page.get_by_text(\"Quote QF-4821\", exact=True)\n        await quote_heading.wait_for(state=\"visible\", timeout=10000)\n        total_panel = page.locator(\"div.totals\")\n        await total_panel.wait_for(state=\"visible\", timeout=10000)\n        await page.locator(\"#calculate-total\").click()\n        await total_panel.locator(\"strong\").wait_for(state=\"visible\", timeout=10000)\n        total_text = (await total_panel.locator(\"strong\").inner_text()).strip()\n        normalized_total = total_text.replace(\"$\", \"\").replace(\",\", \"\").strip()\n        order_total = float(normalized_total)\n        return {\n          \"quote_id\": \"QF-4821\",\n          \"order_total\": order_total,\n          \"displayed_total\": total_text,\n          \"evidence_text\": (await total_panel.inner_text()).strip()\n        }\n",
      "staged_workflow_yaml": null,
      "outcome": {
        "phase": "persisted_block_run",
        "attempted_tool": "update_and_run_blocks",
        "attempted_block_label": "calculate_and_extract_quote_total",
        "attempted_call_ref": "locator:div.totals",
        "verdict": "repairable_failure",
        "reason_code": "runtime_block_failure",
        "workflow_run_id": "wr_569288173990568574",
        "block_labels": [
          "calculate_and_extract_quote_total"
        ],
        "executed_block_labels": [
          "calculate_and_extract_quote_total"
        ],
        "structural_failure_identity": "code-block-exception:wr_569288173990568574",
        "failed_block_labels": [
          "calculate_and_extract_quote_total"
        ]
      }
    },
    {
      "workflow_yaml": "title: Retrieve deferred freight quote total\nworkflow_definition:\n  parameters: []\n  blocks:\n    - block_type: code\n      label: calculate_and_extract_quote_total\n      prompt: Open quote QF-4821, calculate its shipping-inclusive order total, and return the page-displayed total as a number.\n      code: |\n        await page.goto(\"http://localhost:8900/deferred_total_quote/\")\n        quote_heading = page.get_by_text(\"Quote QF-4821\", exact=True)\n        await quote_heading.wait_for(state=\"visible\", timeout=10000)\n        total_panel = page.locator(\"div.totals\")\n        await total_panel.wait_for(state=\"visible\", timeout=10000)\n        await page.locator(\"#calculate-total\").click()\n        page_total = page.locator(\"#order-total\")\n        await page_total.wait_for(state=\"visible\", timeout=10000)\n        total_text = (await page_total.inner_text()).strip()\n        normalized_total = total_text.replace(\"$\", \"\").replace(\",\", \"\").strip()\n        order_total = float(normalized_total)\n        return {\n          \"quote_id\": \"QF-4821\",\n          \"order_total\": order_total,\n          \"displayed_total\": total_text,\n          \"evidence_text\": (await total_panel.inner_text()).strip()\n        }\n",
      "staged_workflow_yaml": null,
      "outcome": {
        "phase": "persisted_block_run",
        "attempted_tool": "update_and_run_blocks",
        "attempted_block_label": "calculate_and_extract_quote_total",
        "attempted_call_ref": "",
        "verdict": "repairable_failure",
        "reason_code": "runtime_block_failure",
        "workflow_run_id": "wr_569288324314423984",
        "block_labels": [
          "calculate_and_extract_quote_total"
        ],
        "executed_block_labels": [
          "calculate_and_extract_quote_total"
        ],
        "structural_failure_identity": "code-block-exception:wr_569288324314423984",
        "failed_block_labels": [
          "calculate_and_extract_quote_total"
        ]
      }
    },
    {
      "workflow_yaml": "title: Retrieve deferred freight quote total\nworkflow_definition:\n  parameters: []\n  blocks:\n    - block_type: code\n      label: calculate_and_extract_quote_total\n      prompt: Open quote QF-4821, calculate its shipping-inclusive order total, and return the page-displayed total as a number.\n      code: |\n        await page.goto(\"http://localhost:8900/deferred_total_quote/\")\n        quote_heading = page.get_by_text(\"Quote QF-4821\", exact=True)\n        await quote_heading.wait_for(state=\"visible\", timeout=10000)\n        total_panel = page.locator(\"div.totals\")\n        await total_panel.wait_for(state=\"visible\", timeout=10000)\n        await page.locator(\"#calculate-total\").click()\n        page_total = page.locator(\"#order-total\")\n        await page_total.wait_for(state=\"visible\", timeout=10000)\n        total_text = \"\"\n        for _ in range(20):\n          total_text = (await page_total.inner_text()).strip()\n          if total_text.startswith(\"$\"):\n            break\n          await page.wait_for_timeout(500)\n        if not total_text.startswith(\"$\"):\n          raise ValueError(\"The calculated page total did not become available\")\n        normalized_total = total_text.replace(\"$\", \"\").replace(\",\", \"\").strip()\n        order_total = float(normalized_total)\n        return {\n          \"quote_id\": \"QF-4821\",\n          \"order_total\": order_total,\n          \"displayed_total\": total_text,\n          \"evidence_text\": (await total_panel.inner_text()).strip()\n        }\n    - block_type: code\n      label: notify_owner\n      prompt: Post the total to the internal notifier.\n      code: |\n        await page.goto(\"http://localhost:8900/notifier/\")\n        return {\"posted\": True}\n",
      "staged_workflow_yaml": null,
      "outcome": {
        "phase": "persisted_block_run",
        "attempted_tool": "update_and_run_blocks",
        "verdict": "progress_observed",
        "reason_code": "verified_success",
        "workflow_run_id": "wr_569288397328868066",
        "block_labels": [
          "calculate_and_extract_quote_total"
        ],
        "executed_block_labels": [
          "notify_owner"
        ],
        "evidence_refs": [
          "calculate_and_extract_quote_total_output"
        ]
      }
    }
  ],
  "reported_workflow_yaml": null,
  "expect": {
    "handback_ok": true,
    "latest_verdict": "progress_observed",
    "prior_attempt_change_identity": null,
    "history": [
      {
        "workflow_run_id": "wr_569288173990568574",
        "verdict": "repairable_failure",
        "reason_code": "runtime_block_failure",
        "attempted_block_label": "calculate_and_extract_quote_total",
        "attempted_block_signature": "d38636478712129a960e18a8e4c82d7e3cfcf05453fbc16372a4a4a906b58c31",
        "attempted_block_code_hash": "0cddef90804f1492ba867612cf5db2d2751f7b53422a11638ab90f4ae0a6e766",
        "executed_yaml_digests": {
          "calculate_and_extract_quote_total": "5e7d6569e3d0c81b"
        }
      },
      {
        "workflow_run_id": "wr_569288324314423984",
        "verdict": "repairable_failure",
        "reason_code": "runtime_block_failure",
        "attempted_block_label": "calculate_and_extract_quote_total",
        "attempted_block_signature": "9598018020211662cee43dafac0b5a66bceaf36c968740898be09ec17f43ca1d",
        "attempted_block_code_hash": "dde73d60cffd3459fd03230d669e8443112c8f3fdf0d4a312d9f8634fa90a4c8",
        "executed_yaml_digests": {
          "calculate_and_extract_quote_total": "ccca57d6e4e3dc93"
        }
      },
      {
        "workflow_run_id": "wr_569288397328868066",
        "verdict": "progress_observed",
        "reason_code": "verified_success",
        "attempted_block_label": "",
        "attempted_block_signature": "",
        "attempted_block_code_hash": "",
        "executed_yaml_digests": {
          "notify_owner": "066e9d85ab67965c"
        }
      }
    ]
  }
}