purge: remove ALL hardcoded UI markers + model defaults from SAE

TDD cycle (RED → GREEN):

SAE perceive() — Zero Maintenance:
- Removed ALL hardcoded marker tuples (instagram_modal_markers,
  creation_flow_markers, dismiss_button_patterns, blocked_markers)
- Removed ALL hardcoded model names (llava:latest, qwen3.5:latest)
- Removed ALL hardcoded URLs (localhost:11434)
- Removed naked except blocks with model fallback defaults

New autonomous flow (zero hardcoded UI identifiers):
1. Package-based foreign app detection (Android-level, not app-specific)
2. Qdrant semantic cache (O(1) recall of learned screen types)
3. ScreenIdentity structural delegation (MODAL/FOREIGN_APP)
4. LLM autonomous classification (first-encounter learning then cached)

GOAP smart UI polling:
- Replaced static random.uniform(1.6, 2.8) sleep with MAX_POLLS=5
  polling loop that detects actual UI transitions

Model config centralized via _get_model_config():
- ALL model/URL lookups go through Config() SSOT
- Fail Fast - no silent hardcoded fallbacks

Tests: 9 new, 119 passing, 0 regressions
This commit is contained in:
2026-05-04 00:07:16 +02:00
parent 32731ed7ec
commit c98e2caaa1
18 changed files with 335 additions and 184 deletions

View File

@@ -30,11 +30,13 @@ Found in `sensors/honeypot_radome.py`.
- **VLM Sanity Guard**: Woven into `telepathic_engine.py`, it sends semantic matches for destructive actions (Like/Follow) through a Vision Language Model step to prevent executing semantic "Bait and Switch" tricks.
### 🧠 Situational Awareness Engine (SAE)
Found in `situational_awareness.py`. Handles autonomous obstacle detection, recovery, and learning without hardcoded rules.
- **3-Layer Modal Fast-Path**: Eliminates LLM hallucination traps for Instagram-internal modals (surveys, rating prompts) via O(1) deterministic structural checks:
1. **Resource-ID Guard**: Detects internal blocking overlays (e.g., `survey_overlay_container`, `nux_overlay`).
2. **Dismiss-Button Heuristic**: Cross-validates typical negative actions ("Not Now", "Take Survey") with overlay structures to prevent false positives in post captions.
3. **Zero-Deception Fallback**: If structural markers fail, falls back to `ScreenMemoryDB` and ultimately the LLM. Structured invariants always override the semantic cache.
Found in `situational_awareness.py`. Handles autonomous obstacle detection, recovery, and learning with **ZERO hardcoded UI element identifiers**.
- **Autonomous 3-Layer Classification** (zero maintenance — no resource-ids, no button text, no localized strings):
1. **Package-Based Foreign App Detection**: If our app's package is absent from the XML hierarchy, it's a foreign app. Uses Android package names (not Instagram UI elements).
2. **Qdrant Semantic Cache**: Previously classified screens are instantly recalled from the vector database (O(1) latency). The bot learns from every first-encounter.
3. **ScreenIdentity Structural Delegation**: The `ScreenIdentity` module classifies known screen types via its own structural logic. If it identifies a MODAL, the SAE trusts it.
4. **LLM Autonomous Classification**: Unknown screens are classified by the LLM (OBSTACLE_MODAL, DANGER_ACTION_BLOCKED, or NORMAL). Results are cached in Qdrant — so each screen type is learned exactly once.
- **Zero-Maintenance Guarantee**: When Instagram updates its UI (changes resource-ids, adds new modals), the bot discovers and learns the new patterns autonomously via the LLM. No code changes required.
### 🦾 Biometric Facade (Gaussian Clicks)
Found in `device_facade.py`.