"""AA-045-F2 Fix 2: Render-Semaphor von 1 auf 2 erhoehen (parallele Formate)."""
p = "/opt/struktur/social-media-agent/app.py"
s = open(p).read()
old = "_PACKAGE_RENDER_SLOTS = threading.BoundedSemaphore(1)"
new = "# AA-045-F2: 2 Slots — das Cockpit fordert 1x1 und 4x5 parallel an (Promise.all)\n_PACKAGE_RENDER_SLOTS = threading.BoundedSemaphore(2)"
assert old in s, "anchor fehlt"
s = s.replace(old, new)
open(p, "w").write(s)
print("app.py gepatcht: Semaphore 1 -> 2")