{
  "access": {
    "local_publish_rc": 0,
    "ping_pve_mgts_rc": 0,
    "ping_vm100_rc": 0,
    "ping_vm101_rc": 0,
    "ssh_pve_mgts_rc": 0,
    "ssh_vm121_rc": 0,
    "trycf_publish_rc": 0
  },
  "changes": {
    "db_changed": "NO",
    "new_peer_created": "NO",
    "private_material_published": "NO",
    "remote_script_executed": "NO",
    "selector_changed": "NO",
    "vm100_changed": "NO_READ_ONLY_CHECK_ONLY",
    "vm101_changed": "NO_READ_ONLY_CHECK_ONLY",
    "wg_paid_changed": "NO"
  },
  "mode": "CORRECTED_PRE_REAL_CS5_READINESS_ACTIVE_CONFLICT_MODEL",
  "plan_future_cs5": {
    "rc": 0,
    "result": {
      "action": "append",
      "apply_performed": false,
      "contract_valid": true,
      "error_count": 0,
      "errors": [],
      "exact_line": "10.253.1.14 cs5 canary_vpn2",
      "idempotent_noop": false,
      "mode": "remote-dry-run",
      "payload_summary": {
        "fwmark": "0x202",
        "interface_name": "vpn2",
        "manager_id": "hmn_pool",
        "provider_type": "hmn_amneziawg",
        "selector_class": "cs5",
        "selector_label": "canary_vpn2",
        "slot_code": "vpn2",
        "table_id": 202,
        "tunnel_ip": "10.253.1.14"
      },
      "remote_commands_executed": false,
      "remote_script": "#!/bin/sh\nset -u\n\nCONF=/etc/router-wgpay-selector.d/peers.conf\nSERVICE=router-wgpay-canary\nLINE='10.253.1.14 cs5 canary_vpn2'\nTUNNEL_IP=10.253.1.14\nSELECTOR_CLASS=cs5\nBACKUP=\"/root/peers.conf.before-agent-selector-apply-$(date +%Y%m%d-%H%M%S)\"\nROLLBACK=\"/root/rollback-agent-selector-apply.sh\"\n\necho \"remote_script_schema=wg-access-agent-selector-remote-script-v3\"\necho \"remote_script_action=append\"\n\ntest -f \"$CONF\"\n\ncp \"$CONF\" \"$BACKUP\"\necho \"selector_backup_path=$BACKUP\"\n\ncat > \"$ROLLBACK\" <<RB\n#!/bin/sh\nset -u\ncp \"$BACKUP\" \"$CONF\"\n/etc/init.d/$SERVICE start\nRB\nchmod 700 \"$ROLLBACK\"\necho \"rollback_path=$ROLLBACK\"\n\n\nif grep -Fxq \"$LINE\" \"$CONF\"; then\n  echo \"selector_apply_action=noop_already_present\"\nelse\n  printf '%s\\n' \"$LINE\" >> \"$CONF\"\n  echo \"selector_apply_action=append\"\nfi\n\n\n/etc/init.d/$SERVICE start\n\ngrep -Fxq \"$LINE\" \"$CONF\"\n/etc/init.d/$SERVICE enabled >/dev/null 2>&1\nnft -a list ruleset 2>/dev/null | grep -q \"$TUNNEL_IP.*$SELECTOR_CLASS\"\n\necho \"postcheck_selector_line_present=YES\"\necho \"postcheck_selector_service_enabled=YES\"\necho \"postcheck_nft_rule_visible=YES\"\n",
      "remote_script_contains_actual_backup_rollback": true,
      "remote_script_contains_bad_etc_initd_quoted_service": false,
      "remote_script_contains_clean_service_start": true,
      "remote_script_contains_placeholder_backup": false,
      "remote_script_contains_runtime_backup_date": true,
      "remote_script_executed": false,
      "remote_script_line_count": 46,
      "remote_script_model": "single_shell_script",
      "remote_script_sha256": "a26e23bd3d2d63e93017ed1e1ca0b27ba6329ee1143d39f3175c63d8078e8ae1",
      "requires_wg_peer_before_real_apply": true,
      "schema": "wg-access-agent-selector-remote-plan-v3",
      "selector_plan": {
        "action": "append",
        "apply_performed": false,
        "contract_valid": true,
        "errors": [],
        "exact_line": "10.253.1.14 cs5 canary_vpn2",
        "exact_present": false,
        "idempotent_noop": false,
        "mode": "dry-run",
        "payload_summary": {
          "fwmark": "0x202",
          "interface_name": "vpn2",
          "manager_id": "hmn_pool",
          "peer_id": "DRY_RUN_FUTURE_PEER_ID",
          "provider_type": "hmn_amneziawg",
          "selector_class": "cs5",
          "selector_label": "canary_vpn2",
          "slot_code": "vpn2",
          "subscription_id": "DRY_RUN_FUTURE_SUBSCRIPTION_ID",
          "table_id": 202,
          "tunnel_ip": "10.253.1.14"
        },
        "same_ip_conflict_count": 0,
        "same_selector_class_conflict_count": 0,
        "same_selector_label_conflict_count": 0,
        "schema": "wg-access-agent-selector-apply-plan-v1",
        "selector_entry_count_after_planned": 5,
        "selector_entry_count_before": 4,
        "slot_status": "healthy",
        "warnings": [],
        "would_append": true
      },
      "selector_plan_rc": 0,
      "target": {
        "host": "10.71.100.1",
        "name": "vm100",
        "selector_conf": "/etc/router-wgpay-selector.d/peers.conf",
        "selector_service": "router-wgpay-canary"
      },
      "would_append": true
    }
  },
  "publish": {
    "current_trycf_url": "https://helena-background-beam-harry.trycloudflare.com",
    "local_report": "http://127.0.0.1:8099/r/e94a0859747d7b96f29c7fdafc2d0351ba603bb0a7e9e5a4/20260709-075543_step040i4_corrected_pre_real_cs5_readiness/",
    "trycf_report": "https://helena-background-beam-harry.trycloudflare.com/r/e94a0859747d7b96f29c7fdafc2d0351ba603bb0a7e9e5a4/20260709-075543_step040i4_corrected_pre_real_cs5_readiness/"
  },
  "readiness": {
    "access_ok": true,
    "all_ready_for_real_cs5": true,
    "backend_ok": true,
    "db_active_conflict_absent": true,
    "db_ip14_reusable_under_active_conflict_model": true,
    "legacy_table200_untouched": true,
    "planner_v3_append_ready": true,
    "remote_script_clean": true,
    "vm100_counts_expected": true,
    "vm100_cs1_to_cs4_present": true,
    "vm100_cs5_absent": true,
    "vm101_vpn2_cs5_ready": true,
    "vm121_mgts_ok": true
  },
  "schema": "router-step-facts-v1",
  "step": "STEP_040I4_CORRECTED_PRE_REAL_CS5_READINESS",
  "vm100": {
    "nft_cs5_rule_visible_rc": 1,
    "selector_active_count": 4,
    "selector_cs1_present_rc": 0,
    "selector_cs2_present_rc": 0,
    "selector_cs3_present_rc": 0,
    "selector_cs4_present_rc": 0,
    "selector_cs5_present_rc": 1,
    "selector_lines": [
      "10.253.1.10 cs1 canary_vpn3",
      "10.253.1.11 cs2 canary_vpn4",
      "10.253.1.12 cs3 canary_vpn5",
      "10.253.1.13 cs4 canary_vpn1"
    ],
    "wg_paid_cs5_peer_visible_rc": 1,
    "wg_paid_peer_count": 4
  },
  "vm101": {
    "fwmark_0x202_rule_rc": 0,
    "legacy_table200_vpn1_rc": 0,
    "slot_count": 5,
    "slot_registry_exists_rc": 0,
    "slots": {
      "vpn1": {
        "fwmark": "0x201",
        "interface_name": "vpn1",
        "selector_class": "cs4",
        "status": "healthy",
        "table_id": 201
      },
      "vpn2": {
        "fwmark": "0x202",
        "interface_name": "vpn2",
        "selector_class": "cs5",
        "status": "healthy",
        "table_id": 202
      },
      "vpn3": {
        "fwmark": "0x203",
        "interface_name": "vpn3",
        "selector_class": "cs1",
        "status": "healthy",
        "table_id": 203
      },
      "vpn4": {
        "fwmark": "0x204",
        "interface_name": "vpn4",
        "selector_class": "cs2",
        "status": "healthy",
        "table_id": 204
      },
      "vpn5": {
        "fwmark": "0x205",
        "interface_name": "vpn5",
        "selector_class": "cs3",
        "status": "healthy",
        "table_id": 205
      }
    },
    "status_json_parse_rc": 0,
    "status_run_rc": 0,
    "status_tool_exists_rc": 0,
    "table202_vpn2_route_rc": 0
  },
  "vm121": {
    "assessment": {
      "ip14_active_conflict": false,
      "ip14_has_enabled_true_db_record": false,
      "ip14_has_historical_db_record": true,
      "ip14_has_pending_or_running_related_job": false,
      "ip14_only_disabled_records": true,
      "ip14_reusable_under_active_conflict_model": true
    },
    "backend": {
      "health_rc": 0,
      "openapi_has_admin_subscriptions": true,
      "openapi_rc": 0
    },
    "changes": {
      "backend_changed": "NO",
      "db_changed": "NO",
      "private_material_published": "NO"
    },
    "db": {
      "docker_ps_rc": 0,
      "pg_container_found": true,
      "pg_container_name": "wgaccess-postgres",
      "ping_rc": 0,
      "public_tables": [
        "alembic_version",
        "invite_codes",
        "orders",
        "peers",
        "provisioning_jobs",
        "subscriptions",
        "users"
      ]
    },
    "errors": [],
    "jobs": {
      "job_table": "provisioning_jobs",
      "job_table_found": true,
      "pending_or_running_related_count": 0,
      "related_count": 2,
      "related_query_rc": 0,
      "related_rows": [
        {
          "action": "enable_peer",
          "created_at": "2026-07-04 13:28:02.966879+00",
          "id": "a16ef565-d195-4302-acb3-c7d963b2f3a5",
          "peer_id": "813515db-bf25-46c9-bc83-c9c45d51ba68",
          "started_at": "2026-07-04 13:28:03.078559+00",
          "status": "completed"
        },
        {
          "action": "disable_peer",
          "created_at": "2026-07-04 15:13:41.91839+00",
          "id": "8594e558-1c0d-4c49-872e-a1c47dc0f377",
          "peer_id": "813515db-bf25-46c9-bc83-c9c45d51ba68",
          "started_at": "2026-07-04 15:13:42.710314+00",
          "status": "completed"
        }
      ],
      "status_counts": {
        "completed": 40
      }
    },
    "mode": "READ_ONLY_ACTIVE_CONFLICT_MODEL",
    "peers": {
      "enabled_true_tunnel_ip_counts": {
        "10.253.1.10": 1,
        "10.253.1.11": 1,
        "10.253.1.12": 1,
        "10.253.1.13": 1
      },
      "enabled_true_tunnel_ip_counts_query_rc": 0,
      "ip14_disabled_with_disabled_at_count": 1,
      "ip14_enabled_false_count": 1,
      "ip14_enabled_true_count": 0,
      "ip14_query_rc": 0,
      "ip14_rows": [
        {
          "created_at": "2026-07-04 13:28:02.964577+00",
          "disabled_at": "2026-07-04 15:13:41.913497+00",
          "enabled": "false",
          "id": "813515db-bf25-46c9-bc83-c9c45d51ba68",
          "node_id": "ddn-test",
          "public_key_md5": "6a14a78db834c09dd1bcb876ee832843",
          "tunnel_ip": "10.253.1.14",
          "user_id": "ade5215e-4229-4e83-9012-f09f4691b4e6"
        }
      ],
      "ip14_total_count": 1
    },
    "schema": "router-step-facts-v1",
    "step": "STEP_040I4_CORRECTED_PRE_REAL_CS5_READINESS",
    "wg": {
      "ping_10_71_100_1_rc": 0,
      "ping_10_71_100_222_rc": 0,
      "ping_10_71_100_2_rc": 0,
      "wg_mgts_peer_count": 1
    }
  }
}
