chore: purge garbage scripts from repo and harden .gitignore

This commit is contained in:
2026-05-03 23:29:14 +02:00
parent c641204a6b
commit 565bdaa568
3 changed files with 7 additions and 53 deletions

8
.gitignore vendored
View File

@@ -31,8 +31,14 @@ Pipfile.lock
*.ini
*.db
# Debug artifacts
# Debug artifacts & garbage scripts (Rule 5: KRIEG DEM MÜLL)
scratch*.py
rewrite_*.py
test_*.py
!tests/**
update_*.py
profile_dump.*
resp_dump.*
test_compress.py
test_fixtures.py
output.txt

View File

@@ -1,19 +0,0 @@
import os
import glob
import re
for file in glob.glob("tests/e2e/test_workflow_*.py"):
with open(file, "r") as f:
content = f.read()
# Remove FakeSAENormal class definition
content = re.sub(r'class FakeSAENormal:\n(?: {4}.*\n)+', '', content)
# Remove monkeypatch.setattr for SituationalAwarenessEngine
content = re.sub(r' +monkeypatch\.setattr\(\n +["\']GramAddict\.core\.behaviors\.obstacle_guard\.SituationalAwarenessEngine["\'],\n +FakeSAENormal,?\n +\)\n', '', content)
# Also inline ones
content = re.sub(r' +monkeypatch\.setattr\("GramAddict\.core\.behaviors\.obstacle_guard\.SituationalAwarenessEngine", FakeSAENormal\)\n', '', content)
with open(file, "w") as f:
f.write(content)
print("Removed FakeSAENormal from all tests")

View File

@@ -1,33 +0,0 @@
from GramAddict.core.llm_provider import query_telepathic_llm
xml = """
<node package="com.instagram.android">
<node resource-id="com.instagram.android:id/gallery_cancel_button" bounds="[10,10][20,20]" />
<node resource-id="com.instagram.android:id/feed_tab" selected="true" bounds="[0,0][1080,2400]" />
</node>
"""
system_prompt = (
"You are an Android UI navigation agent. Your job is to escape obstacles "
"(dialogs, modals, foreign apps, system popups) and return to Instagram. "
"Analyze the screen content (Screenshot AND XML) and return a JSON escape action.\n\n"
"Rules:\n"
"- If you see a dismiss/close/cancel/skip/not now button, click it\n"
"- If the Situation type is OBSTACLE_LOCKED_SCREEN, action must be 'unlock'\n"
"- If the Situation type is OBSTACLE_FOREIGN_APP, action must be 'back'\n"
"- If there is NO obstacle and the screen is a normal Instagram view (false positive), action must be 'false_positive'\n"
"- 'reason' must explain why.\n"
'Output ONLY valid JSON matching: {"action": "click"|"back"|"unlock"|"false_positive", "x": int, "y": int, "reason": str}'
)
user_prompt = f"Situation: OBSTACLE_MODAL\n\nXML Hierarchy:\n{xml}\n\nWhat action should I take to clear this obstacle and return to Instagram? Return JSON only."
print(
query_telepathic_llm(
url="http://localhost:11434/api/generate",
model="llava:latest",
user_prompt=user_prompt,
system_prompt=system_prompt,
images_b64=None,
temperature=0.0,
)
)