Explorer
/proc/109/root/tmp/aa050_patch5.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-radar/sma_core/production.py'); s=p.read_text()
old='''        if source is None:
            raise ProductionError("source_missing", "selected source impulse is unavailable", retryable=True)
        if classification["taxonomy_version_id"] != handoff["taxonomy_version_id"]:
'''
new='''        if source is None:
            raise ProductionError("source_missing", "selected source impulse is unavailable", retryable=True)
        # Zentrales MAS-Fachgate: persistierte Signalzeilen sind die einzige
        # zulässige Quelle für Content-Produktion. NULL/0/Blockierung fail-closed.
        if source["mas_relevant"] != 1 or source["content_blocked"] != 0:
            raise ProductionError("mas_content_gate_blocked", "source signal is not content-eligible", retryable=False)
        if classification["taxonomy_version_id"] != handoff["taxonomy_version_id"]:
'''
assert old in s
p.write_text(s.replace(old,new))