agent: cwd-aware memory fact filter for bounded autonomy
Long-term memory stored context-dependent path facts (e.g. "project_root
→ /home/.../navi-1") as global user facts. search_facts injected them into
any session, so when working in another project the agent was told "the
project root is navi-1" and drifted there.

When scope_boundary_enabled and a session cwd is set, _memory_facts_msg now
drops facts whose value is an absolute path outside the session cwd tree.
Facts are kept when working inside that path (then they are correct), and
non-path/relative facts always pass. Free flight stays reproducible by
toggling the flag off. No facts deleted, extractor untouched.

Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2e06b02 commit fc0546c6e65cf2dbc0a8fee9c60b98b8953ad974
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 21 hours ago
Showing 3 changed files
View
navi/core/agent.py
View
navi/core/context_builder.py
View
tests/unit/core/test_context_builder.py