feat(navigation): Implement 100% autonomous Blank Start architecture; purge heuristics

This commit is contained in:
2026-04-22 00:05:03 +02:00
parent fff9ec5b0a
commit 75009d91a2
41 changed files with 1875 additions and 231 deletions

View File

@@ -102,6 +102,17 @@ Measures the "IQ" and latency of your LLM models to ensure they are suitable for
---
## 7. Latency and Adaptive Snap Validation
Ensuring the agent handles slow network responses or missing feed markers (e.g., getting trapped in a Story) is critical for Full Self-Driving autonomy.
- **Concept**: Simulates UI rendering delays to trigger the `post_load_timeout` and verify the `Adaptive Snap` recovery logic.
- **Implementation**: When testing `bot_flow.py`, mock `_wait_for_post_loaded` or the underlying `device.dump_hierarchy()` to return an incomplete or missing feed XML (like `reel_viewer_root`) to verify the bot presses `back` or wobbles successfully.
- **Key Assertions**:
- Verify that `nav_graph.do('align')` or `device.press("back")` is called when `_wait_for_post_loaded` fails to find `FEED_MARKERS`.
- Validate that the timeout gracefully escapes loop-locks rather than blindly proceeding with bad UI state.
---
## 🛠 Troubleshooting
- **Device offline**: Ensure that `adb devices` lists your device and it is authorized.
- **LLM Timeout**: Verify that Ollama is running (`ollama list`) and the required model (e.g., `qwen3.5:latest`) is loaded.
@@ -110,11 +121,23 @@ Measures the "IQ" and latency of your LLM models to ensure they are suitable for
---
## 💎 Golden Rules of Implementation
To maintain 100% reliability and "Tesla-level" autonomy, every developer (and AI agent) MUST follow these rules:
1. **Strict Green Light Policy**: All tests (both existing and new) MUST be green before a task is considered finished. No exceptions.
2. **No Fix Without a Red Test**: Never implement a fix or a feature without first having a failing test that demonstrates the problem or the missing capability.
3. **Explicit Test Summary**: Every completion summary must explicitly list exactly which tests were added or modified to verify the change.
4. **Exhaustive Edge-Case Coverage**: Consider and test for failure modes: "What if the DB is down?", "What if the screen is empty?", "What if the user is in a state we've never seen?".
5. **Efficient, Fail-Fast Testing**:
* Do not run the entire suite if you know where the failure is.
* Run targeted tests immediately after a change.
* Fail fast: fix the first failing test before moving to the next.
* Maintain a mental (or written) list of remaining failing tests to ensure none are forgotten.
---
## 💎 Best Practices & No-Gos
To maintain a high-fidelity test suite, all developers must adhere to these standards:
### ✅ Best Practices
- **Use Golden Fixtures**: Always use real, freshly pulled XML dumps. If the Instagram UI changes, update the fixtures immediately using the Testing Toolkit.
- **Singleton Isolation**: Ensure all core singletons (`TelepathicEngine`, `GoalExecutor`) are reset between tests in `conftest.py`.
- **Hermetic Tests**: Each test must be independent. Ensure on-disk caches (JSON files) are wiped before each run.