{
  "assessment": {
    "all_ok": true,
    "blockers": [],
    "decision": "PASS_STEP_044K_RUNTIME_EGRESS_ACTIVITY_SAMPLER_DRYRUN_DB_UPDATE_PREVIEW",
    "expected_absence": {
      "activity_eval_written_to_db": false,
      "client_config_published": false,
      "force_mode_enabled": false,
      "manual_agent_service_start_used": false,
      "private_material_published": false,
      "rebalance_paused": false,
      "selector_changed": false,
      "vm100_changed": false,
      "vm101_changed": false,
      "vm121_db_changed": false,
      "wg_peer_runtime_changed": false
    },
    "success_checks": {
      "activity_in_rules_five": true,
      "activity_out_rules_five": true,
      "activity_service_enabled": true,
      "activity_service_status_ok": true,
      "activity_table_present": true,
      "allocator_enabled": true,
      "counter_rows_ten": true,
      "dryrun_active_preview_created": true,
      "dryrun_all_counter_pairs_present": true,
      "dryrun_db_update_preview_only": true,
      "dryrun_rows_five": true,
      "dryrun_rows_match_selector_classes": true,
      "enabled_peers_five": true,
      "force_mode_off": true,
      "forced_leases_zero": true,
      "lease_columns_query_ok": true,
      "lease_rows_five": true,
      "leases_query_ok": true,
      "pending_jobs_zero": true,
      "public_index_rebuilt": true,
      "public_report_created": true,
      "rebalance_not_paused": true,
      "required_sampler_columns_present": true,
      "selector_rows_five": true,
      "settings_query_ok": true,
      "settings_thresholds_loaded": true,
      "targets_query_ok": true,
      "vm100_allowed_ip_count_five": true,
      "vm100_counters_collected": true,
      "vm100_peer_count_five": true,
      "vm100_uci_peer_count_zero": true,
      "vm101_cs1_to_vpn3_seen": true,
      "vm101_cs2_to_vpn4_seen": true,
      "vm101_cs3_to_vpn5_seen": true,
      "vm101_cs4_to_vpn1_seen": true,
      "vm101_cs5_to_vpn2_seen": true,
      "vm101_slot_map_collected": true,
      "vm121_db_model_collected": true
    },
    "warnings": [
      "STEP_044K is dry-run only: it previews activity sampler DB updates but does not write them.",
      "Counters currently include absolute packet/byte totals since last activity table creation or reload; future sampler must store baselines to compute deltas over production sample windows.",
      "Optional sampler persistence columns missing and may need schema migration before real sampler writes: last_sample_packets,last_sample_bytes,last_seen_packets,last_seen_bytes"
    ]
  },
  "changes": {
    "client_config_published": "NO",
    "manual_agent_service_start_used": "NO",
    "private_material_published": "NO",
    "selector_changed": "NO",
    "vm100_changed": "NO_READONLY_PREVIEW",
    "vm101_changed": "NO",
    "vm121_db_changed": "NO",
    "wg_peer_runtime_changed": "NO"
  },
  "db_summary": {
    "active_leases": 0,
    "enabled_peers": 5,
    "forced_leases": 0,
    "idle_leases": 5,
    "lease_rows": 5,
    "pending_jobs": 0
  },
  "dryrun_rows": [
    {
      "active_eval_preview": {
        "active_by_bytes": false,
        "active_by_packets": true,
        "active_now": true,
        "proposed_state": "active"
      },
      "counter_names": {
        "in": "peer_10_253_1_10_in_vpn",
        "out": "peer_10_253_1_10_out_vpn"
      },
      "current_state": "idle",
      "egress_class": "cs1",
      "forced": false,
      "observed_absolute_counters": {
        "in_bytes": 6840,
        "in_packets": 30,
        "out_bytes": 6840,
        "out_packets": 30,
        "total_bytes": 13680,
        "total_packets": 60
      },
      "peer_id": "376dfa07-0ba4-4182-af39-389a2cb3badd",
      "selector_class": "cs1",
      "target_id": "cs1_vpn3",
      "threshold": {
        "bytes_min": 16384,
        "cooldown_seconds": 900,
        "idle_seconds": 900,
        "packets_min": 10,
        "sample_seconds": 120
      },
      "tunnel_ip": "10.253.1.10",
      "would_not_update_db_in_this_step": true,
      "would_update_columns_if_present": {
        "last_activity_at": "now()",
        "reason": "activity_sampler_dryrun_active",
        "state": "active",
        "updated_at": "now()"
      }
    },
    {
      "active_eval_preview": {
        "active_by_bytes": false,
        "active_by_packets": false,
        "active_now": false,
        "proposed_state": "idle"
      },
      "counter_names": {
        "in": "peer_10_253_1_11_in_vpn",
        "out": "peer_10_253_1_11_out_vpn"
      },
      "current_state": "idle",
      "egress_class": "cs2",
      "forced": false,
      "observed_absolute_counters": {
        "in_bytes": 0,
        "in_packets": 0,
        "out_bytes": 0,
        "out_packets": 0,
        "total_bytes": 0,
        "total_packets": 0
      },
      "peer_id": "cb533a1a-7070-416d-9272-846327545060",
      "selector_class": "cs2",
      "target_id": "cs2_vpn4",
      "threshold": {
        "bytes_min": 16384,
        "cooldown_seconds": 900,
        "idle_seconds": 900,
        "packets_min": 10,
        "sample_seconds": 120
      },
      "tunnel_ip": "10.253.1.11",
      "would_not_update_db_in_this_step": true,
      "would_update_columns_if_present": {
        "last_activity_at": "unchanged",
        "reason": "activity_sampler_dryrun_idle",
        "state": "idle",
        "updated_at": "now()"
      }
    },
    {
      "active_eval_preview": {
        "active_by_bytes": false,
        "active_by_packets": false,
        "active_now": false,
        "proposed_state": "idle"
      },
      "counter_names": {
        "in": "peer_10_253_1_12_in_vpn",
        "out": "peer_10_253_1_12_out_vpn"
      },
      "current_state": "idle",
      "egress_class": "cs3",
      "forced": false,
      "observed_absolute_counters": {
        "in_bytes": 0,
        "in_packets": 0,
        "out_bytes": 0,
        "out_packets": 0,
        "total_bytes": 0,
        "total_packets": 0
      },
      "peer_id": "a3cbe3b5-8416-4847-b5ee-21f42359b465",
      "selector_class": "cs3",
      "target_id": "cs3_vpn5",
      "threshold": {
        "bytes_min": 16384,
        "cooldown_seconds": 900,
        "idle_seconds": 900,
        "packets_min": 10,
        "sample_seconds": 120
      },
      "tunnel_ip": "10.253.1.12",
      "would_not_update_db_in_this_step": true,
      "would_update_columns_if_present": {
        "last_activity_at": "unchanged",
        "reason": "activity_sampler_dryrun_idle",
        "state": "idle",
        "updated_at": "now()"
      }
    },
    {
      "active_eval_preview": {
        "active_by_bytes": false,
        "active_by_packets": false,
        "active_now": false,
        "proposed_state": "idle"
      },
      "counter_names": {
        "in": "peer_10_253_1_13_in_vpn",
        "out": "peer_10_253_1_13_out_vpn"
      },
      "current_state": "idle",
      "egress_class": "cs4",
      "forced": false,
      "observed_absolute_counters": {
        "in_bytes": 0,
        "in_packets": 0,
        "out_bytes": 0,
        "out_packets": 0,
        "total_bytes": 0,
        "total_packets": 0
      },
      "peer_id": "219a1f63-ec47-4f72-9663-c1a17d82301e",
      "selector_class": "cs4",
      "target_id": "cs4_vpn1",
      "threshold": {
        "bytes_min": 16384,
        "cooldown_seconds": 900,
        "idle_seconds": 900,
        "packets_min": 10,
        "sample_seconds": 120
      },
      "tunnel_ip": "10.253.1.13",
      "would_not_update_db_in_this_step": true,
      "would_update_columns_if_present": {
        "last_activity_at": "unchanged",
        "reason": "activity_sampler_dryrun_idle",
        "state": "idle",
        "updated_at": "now()"
      }
    },
    {
      "active_eval_preview": {
        "active_by_bytes": false,
        "active_by_packets": false,
        "active_now": false,
        "proposed_state": "idle"
      },
      "counter_names": {
        "in": "peer_10_253_1_14_in_vpn",
        "out": "peer_10_253_1_14_out_vpn"
      },
      "current_state": "idle",
      "egress_class": "cs5",
      "forced": false,
      "observed_absolute_counters": {
        "in_bytes": 0,
        "in_packets": 0,
        "out_bytes": 0,
        "out_packets": 0,
        "total_bytes": 0,
        "total_packets": 0
      },
      "peer_id": "e4adcfa1-6fbc-4471-b66b-8d7837f35f9d",
      "selector_class": "cs5",
      "target_id": "cs5_vpn2",
      "threshold": {
        "bytes_min": 16384,
        "cooldown_seconds": 900,
        "idle_seconds": 900,
        "packets_min": 10,
        "sample_seconds": 120
      },
      "tunnel_ip": "10.253.1.14",
      "would_not_update_db_in_this_step": true,
      "would_update_columns_if_present": {
        "last_activity_at": "unchanged",
        "reason": "activity_sampler_dryrun_idle",
        "state": "idle",
        "updated_at": "now()"
      }
    }
  ],
  "dryrun_summary": {
    "active_preview_count": 1,
    "dryrun_rows": 5,
    "idle_preview_count": 4,
    "missing_counter_rows": [],
    "rows_with_selector_match": 5
  },
  "mode": "READONLY_PREVIEW_ACTIVITY_SAMPLER_DB_UPDATES_FROM_VM100_COUNTERS",
  "publish": {
    "local_report": "http://127.0.0.1:8099/r/e94a0859747d7b96f29c7fdafc2d0351ba603bb0a7e9e5a4/20260709-142312_step044k_runtime_egress_activity_sampler_dryrun_db_update_preview/",
    "public_index_rebuilt": true,
    "trycf_report": "https://helena-background-beam-harry.trycloudflare.com/r/e94a0859747d7b96f29c7fdafc2d0351ba603bb0a7e9e5a4/20260709-142312_step044k_runtime_egress_activity_sampler_dryrun_db_update_preview/"
  },
  "sampler_contract": {
    "active_formula": "delta_packets >= 10 OR delta_bytes >= 16384",
    "counter_pair_per_peer": {
      "in": "peer_10_253_1_X_in_vpn",
      "out": "peer_10_253_1_X_out_vpn"
    },
    "dryrun_formula_used_here": "absolute_observed_packets >= 10 OR absolute_observed_bytes >= 16384",
    "future_delta_formula": "current_observed_total - stored_previous_observed_total",
    "observed_total_formula": "out_packets + in_packets and out_bytes + in_bytes",
    "read_command": "nft list counters table inet router_egress_activity",
    "settings": {
      "allocator_enabled": "1",
      "bytes_min": 16384,
      "cooldown_seconds": 900,
      "force_mode": "off",
      "idle_seconds": 900,
      "packets_min": 10,
      "rebalance_paused": "0",
      "sample_seconds": 120
    },
    "source": "VM100 nft counters table inet router_egress_activity",
    "write_policy": {
      "next_real_sampler": "store baselines, last_activity_at, state transitions, updated_at, reason if columns exist or after migration",
      "this_step": "no DB writes"
    }
  },
  "schema": "router-step-facts-v1",
  "schema_summary": {
    "lease_columns": {
      "assigned_at": {
        "data_type": "timestamp with time zone",
        "is_nullable": "NO"
      },
      "assignment_source": {
        "data_type": "text",
        "is_nullable": "NO"
      },
      "cooldown_until": {
        "data_type": "timestamp with time zone",
        "is_nullable": "YES"
      },
      "egress_class": {
        "data_type": "text",
        "is_nullable": "NO"
      },
      "forced": {
        "data_type": "boolean",
        "is_nullable": "NO"
      },
      "id": {
        "data_type": "uuid",
        "is_nullable": "NO"
      },
      "last_activity_at": {
        "data_type": "timestamp with time zone",
        "is_nullable": "YES"
      },
      "last_rx_bytes": {
        "data_type": "bigint",
        "is_nullable": "NO"
      },
      "last_rx_packets": {
        "data_type": "bigint",
        "is_nullable": "NO"
      },
      "last_tx_bytes": {
        "data_type": "bigint",
        "is_nullable": "NO"
      },
      "last_tx_packets": {
        "data_type": "bigint",
        "is_nullable": "NO"
      },
      "peer_id": {
        "data_type": "uuid",
        "is_nullable": "NO"
      },
      "reason": {
        "data_type": "text",
        "is_nullable": "NO"
      },
      "state": {
        "data_type": "text",
        "is_nullable": "NO"
      },
      "target_id": {
        "data_type": "text",
        "is_nullable": "YES"
      },
      "tunnel_ip": {
        "data_type": "inet",
        "is_nullable": "NO"
      },
      "updated_at": {
        "data_type": "timestamp with time zone",
        "is_nullable": "NO"
      }
    },
    "optional_sampler_columns_missing": [
      "last_sample_packets",
      "last_sample_bytes",
      "last_seen_packets",
      "last_seen_bytes"
    ],
    "optional_sampler_columns_present": [
      "last_activity_at",
      "updated_at",
      "reason"
    ],
    "required_sampler_columns": [
      "peer_id",
      "tunnel_ip",
      "egress_class",
      "target_id",
      "state",
      "forced"
    ]
  },
  "step": "STEP_044K_RUNTIME_EGRESS_ACTIVITY_SAMPLER_DRYRUN_DB_UPDATE_PREVIEW",
  "targets": [
    {
      "egress_class": "cs1",
      "fwmark": "0x203",
      "id": "cs1_vpn3",
      "interface_name": "vpn3",
      "is_emergency": false,
      "kind": "vpn",
      "route_table": "203",
      "status": "enabled"
    },
    {
      "egress_class": "cs2",
      "fwmark": "0x204",
      "id": "cs2_vpn4",
      "interface_name": "vpn4",
      "is_emergency": false,
      "kind": "vpn",
      "route_table": "204",
      "status": "enabled"
    },
    {
      "egress_class": "cs3",
      "fwmark": "0x205",
      "id": "cs3_vpn5",
      "interface_name": "vpn5",
      "is_emergency": false,
      "kind": "vpn",
      "route_table": "205",
      "status": "enabled"
    },
    {
      "egress_class": "cs4",
      "fwmark": "0x201",
      "id": "cs4_vpn1",
      "interface_name": "vpn1",
      "is_emergency": false,
      "kind": "vpn",
      "route_table": "201",
      "status": "enabled"
    },
    {
      "egress_class": "cs5",
      "fwmark": "0x202",
      "id": "cs5_vpn2",
      "interface_name": "vpn2",
      "is_emergency": false,
      "kind": "vpn",
      "route_table": "202",
      "status": "enabled"
    }
  ]
}
