from pathlib import Path
p=Path('/opt/struktur/projects-dashboard/app.py')
s=p.read_text()
repl={
"'Potenzial': '9,5/10'":"'Potenzial': '9,6/10'",
"'Potenzial': '9,0/10'":"'Potenzial': '9,5/10'",
"'Potenzial': '8,5/10'":"'Potenzial': '9,2/10'",
"'Potenzial': 'strategisch 10/10'":"'Potenzial': 'strategisch 9,0/10'",
"'Potenzial': '9,2/10'":"'Potenzial': '9,7/10'",
}
for a,b in repl.items():
if a in s: s=s.replace(a,b,1)
marker="CUSTOMER_PROJECT_DOSSIERS = {"
insert="PRIORITY_ORDER = ['ki-wissens-onboarding','sop-agent-system','prozess-human-loop','ai-rezeptionist-lead-agent','skill-library-orchestration','content-landingpage-service']\nCUSTOMER_PROJECTS.sort(key=lambda p: PRIORITY_ORDER.index(p['id']) if p['id'] in PRIORITY_ORDER else 999)\n\n"
if insert not in s:
s=s.replace(marker,insert+marker,1)
p.write_text(s)
print('PRIORITY_PATCH_OK')