""" Verify configuration changes by downloading .set file with SetupClient """ import sys sys.path.insert(0, r'C:\DEV\COPILOT_codex') import geviset_parser # Parse the downloaded configuration config_path = r"C:\GEVISOFT\GeViScopeSetup.set" print("=" * 80) print("VERIFYING CONFIGURATION VIA SETUPCLIENT") print("=" * 80) try: from pathlib import Path config = geviset_parser.load_set(Path(config_path)) # Check servers print("\n1. SERVERS IN CONFIGURATION:") print("-" * 80) gcore_servers = [] if "GeViGCoreServer" in config: gcore_folder = config["GeViGCoreServer"] if "children" in gcore_folder: for server_entry in gcore_folder["children"]: if server_entry["type"] == "folder": server_id = server_entry["name"] children_dict = {c["name"]: c for c in server_entry.get("children", [])} server_info = { "id": server_id, "alias": children_dict.get("Alias", {}).get("value", ""), "host": children_dict.get("Host", {}).get("value", ""), "enabled": children_dict.get("Enabled", {}).get("value", False), "enabled_type": children_dict.get("Enabled", {}).get("type", "unknown") } gcore_servers.append(server_info) print(f" ID: {server_info['id']:5s} | Alias: {server_info['alias']:30s} | " f"Host: {server_info['host']:15s} | Enabled: {server_info['enabled']} ({server_info['enabled_type']})") # Check for Claude servers claude_servers = [s for s in gcore_servers if "Claude" in s["alias"]] print(f"\n Found {len(claude_servers)} Claude test servers") # Check action mappings print("\n2. ACTION MAPPINGS IN CONFIGURATION:") print("-" * 80) mappings = [] if "MappingRules" in config: mapping_rules = config["MappingRules"] if "children" in mapping_rules: for i, mapping in enumerate(mapping_rules["children"], 1): if mapping["type"] == "folder": children_dict = {c["name"]: c for c in mapping.get("children", [])} name = children_dict.get("Name", {}).get("value", f"Mapping {i}") mappings.append({"id": i, "name": name}) print(f" Total mappings: {len(mappings)}") # Find Claude mappings claude_mappings = [m for m in mappings if "Claude" in m["name"]] print(f"\n Claude test mappings:") for m in claude_mappings: print(f" #{m['id']:3d}: {m['name']}") # Find TEST mappings (should be deleted) test_mappings = [m for m in mappings if "TEST" in m["name"]] print(f"\n TEST mappings (should be deleted):") if test_mappings: for m in test_mappings: print(f" #{m['id']:3d}: {m['name']}") else: print(f" (None - successfully cleaned up)") # Verification summary print("\n" + "=" * 80) print("VERIFICATION SUMMARY") print("=" * 80) print(f" Total servers in config: {len(gcore_servers)}") print(f" Claude servers found: {len(claude_servers)}") print(f" Total mappings in config: {len(mappings)}") print(f" Claude mappings found: {len(claude_mappings)}") print(f" TEST mappings remaining: {len(test_mappings)}") # Check bool type for servers print("\n3. BOOL TYPE VERIFICATION:") print("-" * 80) bool_type_correct = all(s["enabled_type"] == "bool" for s in gcore_servers) if bool_type_correct: print(f" [PASS] All {len(gcore_servers)} servers use correct 'bool' type for Enabled field") else: print(f" [FAIL] Some servers not using 'bool' type:") for s in gcore_servers: if s["enabled_type"] != "bool": print(f" Server {s['id']}: type={s['enabled_type']}") print("\n" + "=" * 80) print("VERIFICATION COMPLETE") print("=" * 80) except FileNotFoundError: print(f"\n[ERROR] Configuration file not found: {config_path}") print(" Please ensure SetupClient downloaded the file successfully") except Exception as e: print(f"\n[ERROR] Failed to parse configuration: {e}") import traceback traceback.print_exc()