{
  "id": "woocommerce-csv",
  "action": "Import regular price and stock updates for simple product and variation",
  "edit_path": "Native WC_Product_CSV_Importer::import, existing items, WP-CLI user 1",
  "fixture_result": {
    "imported": [],
    "imported_variations": [],
    "failed": [],
    "updated": [
      11,
      13
    ],
    "skipped": []
  },
  "events": [
    {
      "id": "19",
      "network_id": "1",
      "site_id": "1",
      "occurred_at": "2026-11-22 06:12:49.450864",
      "code": "commerce.stock_changed",
      "category": "commerce",
      "action": "stock_changed",
      "outcome": "stored_change",
      "severity": "notice",
      "actor_kind": "authenticated_user",
      "actor_id": "1",
      "subject_id": null,
      "object_type": "product",
      "object_id": "11",
      "channel": "cli",
      "payload": {
        "event_scope": "site",
        "source": "wordpress",
        "actor_label": "User #1",
        "subject_label": "Not applicable",
        "facts": {
          "product_type": "simple",
          "execution_context": "authenticated_staff"
        },
        "diffs": [
          {
            "field": "quantity",
            "type": "scalar",
            "before": "15",
            "after": "18",
            "availability": "captured",
            "redacted": false
          }
        ],
        "collector": "woocommerce_crud_v1",
        "observed_via": "woocommerce_product_set_stock",
        "confidence": "successful_write_with_prewrite_snapshot",
        "ip_context": {
          "mode": "unavailable",
          "reason": "not_collected_by_this_collector"
        },
        "incomplete_context": false,
        "truncated": false,
        "before_consistency": "prewrite_snapshot_not_serializable_against_concurrent_writes",
        "maintenance": null
      }
    },
    {
      "id": "20",
      "network_id": "1",
      "site_id": "1",
      "occurred_at": "2026-11-22 06:12:49.479869",
      "code": "commerce.product_changed",
      "category": "commerce",
      "action": "product_changed",
      "outcome": "stored_change",
      "severity": "notice",
      "actor_kind": "authenticated_user",
      "actor_id": "1",
      "subject_id": null,
      "object_type": "product",
      "object_id": "11",
      "channel": "cli",
      "payload": {
        "event_scope": "site",
        "source": "wordpress",
        "actor_label": "User #1",
        "subject_label": "Not applicable",
        "facts": {
          "currency": "USD",
          "precision": 2,
          "product_type": "simple",
          "execution_context": "authenticated_staff"
        },
        "diffs": [
          {
            "field": "regular_price",
            "type": "scalar",
            "before": "39.00",
            "after": "42.00",
            "availability": "captured",
            "redacted": false
          }
        ],
        "collector": "woocommerce_crud_v1",
        "observed_via": "woocommerce_after_product_object_save",
        "confidence": "successful_write_with_prewrite_snapshot",
        "ip_context": {
          "mode": "unavailable",
          "reason": "not_collected_by_this_collector"
        },
        "incomplete_context": false,
        "truncated": false,
        "before_consistency": "prewrite_snapshot_not_serializable_against_concurrent_writes",
        "maintenance": null
      }
    },
    {
      "id": "21",
      "network_id": "1",
      "site_id": "1",
      "occurred_at": "2026-11-22 06:12:49.501498",
      "code": "commerce.stock_changed",
      "category": "commerce",
      "action": "stock_changed",
      "outcome": "stored_change",
      "severity": "notice",
      "actor_kind": "authenticated_user",
      "actor_id": "1",
      "subject_id": null,
      "object_type": "product",
      "object_id": "13",
      "channel": "cli",
      "payload": {
        "event_scope": "site",
        "source": "wordpress",
        "actor_label": "User #1",
        "subject_label": "Not applicable",
        "facts": {
          "product_type": "variation",
          "execution_context": "authenticated_staff"
        },
        "diffs": [
          {
            "field": "quantity",
            "type": "scalar",
            "before": "15",
            "after": "9",
            "availability": "captured",
            "redacted": false
          }
        ],
        "collector": "woocommerce_crud_v1",
        "observed_via": "woocommerce_variation_set_stock",
        "confidence": "successful_write_with_prewrite_snapshot",
        "ip_context": {
          "mode": "unavailable",
          "reason": "not_collected_by_this_collector"
        },
        "incomplete_context": false,
        "truncated": false,
        "before_consistency": "prewrite_snapshot_not_serializable_against_concurrent_writes",
        "maintenance": null
      }
    },
    {
      "id": "22",
      "network_id": "1",
      "site_id": "1",
      "occurred_at": "2026-11-22 06:12:49.534837",
      "code": "commerce.product_changed",
      "category": "commerce",
      "action": "product_changed",
      "outcome": "stored_change",
      "severity": "notice",
      "actor_kind": "authenticated_user",
      "actor_id": "1",
      "subject_id": null,
      "object_type": "product",
      "object_id": "13",
      "channel": "cli",
      "payload": {
        "event_scope": "site",
        "source": "wordpress",
        "actor_label": "User #1",
        "subject_label": "Not applicable",
        "facts": {
          "currency": "USD",
          "precision": 2,
          "product_type": "variation",
          "execution_context": "authenticated_staff"
        },
        "diffs": [
          {
            "field": "regular_price",
            "type": "scalar",
            "before": "24.00",
            "after": "26.00",
            "availability": "captured",
            "redacted": false
          }
        ],
        "collector": "woocommerce_crud_v1",
        "observed_via": "woocommerce_after_product_object_save",
        "confidence": "successful_write_with_prewrite_snapshot",
        "ip_context": {
          "mode": "unavailable",
          "reason": "not_collected_by_this_collector"
        },
        "incomplete_context": false,
        "truncated": false,
        "before_consistency": "prewrite_snapshot_not_serializable_against_concurrent_writes",
        "maintenance": null
      }
    }
  ],
  "observed_codes": [
    "commerce.stock_changed",
    "commerce.product_changed",
    "commerce.stock_changed",
    "commerce.product_changed"
  ],
  "expected_event": "commerce.stock_changed",
  "status": "captured",
  "retained_fields": [
    "quantity",
    "regular_price"
  ],
  "retained_fact_names": [
    "currency",
    "execution_context",
    "precision",
    "product_type"
  ],
  "attribution": [
    "authenticated_user; actor_id=1; channel=cli"
  ],
  "limitations": "The native WooCommerce CSV importer updated this simple product and variation with numeric price/stock records. This proves this importer path only, not every third-party import tool. Original CSV contents and importer identity are not retained by the audit event.",
  "alternatives": "Keep the source CSV and WooCommerce importer outcome separately; use product/variation IDs to correlate.",
  "versions": {
    "logged_ai_free": "1.2.16",
    "wordpress": "7.1.5",
    "php": "8.5.4",
    "mariadb": "11.8.6",
    "woocommerce": "11.3.0",
    "order_storage": "HPOS"
  },
  "tested_at": "2026-11-22",
  "sample": "woocommerce-csv.json",
  "screenshot": null
}
