Root cause: get_module_logs_dir() last fallback unconditionally created
src/aipass/{name}/logs/ for any unknown module, causing external projects
(AIPL polyglot) running with AIPASS_HOME set to pollute the AIPass src tree
with src/aipass/unknown_branch/logs/*.
Fix (already committed in 3c5ac29):
- Check AIPASS_CALLER_CWD env var (set by drone during cross-project dispatch,
DPLAN-0121) and walk up to the caller's project root (.git/pyproject.toml)
- Final fallback: system_logs/external/{module_name} — never create unknown
dirs in the AIPass source tree
- Added inspect.stack() auto-detection when module_name is not provided
- Added _warn_routing() helper for lazy prax logger access (avoids circular
imports — logger.py imports load.py at module level)
This PR:
- Regression tests: test_unknown_module_routes_to_system_logs_external and
test_aipass_caller_cwd_routes_to_caller_project (both green)
- Cleanup: moved 27 leaked AIPL polyglot logs from src/aipass/unknown_branch/
to /tmp/aipl_leaked_logs/ for AIPass Developer review; removed directory
- bypass.json: architecture + documentation exemptions for tests/test_config.py
CC @polyglot: AIPL-side logger config may need AIPASS_CALLER_CWD set during
cross-project dispatch so logs route to ~/Projects/AIPL/ correctly. The fix
is transparent if drone sets AIPASS_CALLER_CWD; no AIPL changes required for
the basic fix, but explicit env var support improves log placement accuracy.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>