File size: 1,235 Bytes
9bd4ce5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os

# Mapping of Old -> New standardized interaction strings
REPLACEMENTS = {
    '"SELECT_CHOICE"': '"SELECT_DISCARD"',
    # Add other drift-fixes here if discovered during baseline analysis
}


def bulk_sync():
    src_dir = "engine_rust_src/src"
    test_files = [
        "archetype_tests.rs",
        "ability_tests.rs",
        "trigger_tests.rs",
        "coverage_gap_tests.rs",
        "manual_tests.rs",
    ]

    modified_count = 0

    for filename in test_files:
        path = os.path.join(src_dir, filename)
        if not os.path.exists(path):
            print(f"Skipping {path} (not found)")
            continue

        with open(path, "r", encoding="utf-8") as f:
            content = f.read()

        new_content = content
        for old, new in REPLACEMENTS.items():
            new_content = new_content.replace(old, new)

        if new_content != content:
            with open(path, "w", encoding="utf-8") as f:
                f.write(new_content)
            print(f"Updated {path}")
            modified_count += 1
        else:
            print(f"No changes needed for {path}")

    print(f"Bulk sync complete. Modified {modified_count} files.")


if __name__ == "__main__":
    bulk_sync()