"""Bounded weak-side AI coverage; guarded native wing-target hook, no rating boosts."""
ORIGIN = 0x2D8400

def install(data, assemble, patch):
    code = assemble('ai_defence', ORIGIN)
    assert len(code) < 0xC00, 'AI code reaches private velocity-test region'
    patch(ORIGIN, b'\xff' * len(code), code)
    patch(0xD086, bytes.fromhex('41faff103438b74a'), bytes.fromhex('4eb9') + ORIGIN.to_bytes(4, 'big') + bytes.fromhex('4e71'))
