fix(tests + readme): audit-log test pollution + Phase 3 README refresh#26
Merged
fix(tests + readme): audit-log test pollution + Phase 3 README refresh#26
Conversation
…e refresh ## Test pollution fix Live audit.log on production machine showed agent_started, agent_aborted, agent_blocked_on_permission, agent_message_sent events with agent_id="test_agent" — proof that pytest runs were emitting into the real ~/.codec/audit.log. Same pattern as 2026-05-01 incident. Root cause: temp_codec_dir fixture in test_agent_plan.py, test_agent_runner.py, test_agent_messaging.py monkeypatched codec_agent_plan paths but NOT codec_audit._AUDIT_LOG. So when _run_agent / approve_plan / post_message audit-emitted during tests, the events bypassed the redirect and hit the production log. Fix: extend the 3 temp_codec_dir fixtures to also monkeypatch codec_audit._AUDIT_LOG → tmp_path / "audit.log". Verified: 91/91 Phase 3 tests pass, full suite 930/20/73 baseline preserved. ## README refresh - Badges: tests 378→1023, skills 60→73, lines 33.9K→53.3K, features 238→260+, engine v2.1→v2.3 - §4 CODEC Chat: rewrote to mention Project mode + drop-a-project autonomy, with anchor examples (Marbella property bot, EUR/USD vol) - §"What's Coming": split into "Phase 3.5 (in progress)" and "Beyond Phase 3" sections; lists the 5 remaining Phase 3.5 items (anchor example, proactive overlay, blocked_on_qwen, read_paths enforcement, multi-channel notifications)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two things bundled — a real safety fix found via health check + a README refresh.
1. Test pollution fix (safety)
Live
~/.codec/audit.logon the production machine showedagent_started/agent_aborted/agent_blocked_on_permission/agent_message_sentevents withagent_id="test_agent"— proof that pytest runs were leaking into the real production log. Same pattern as the 2026-05-01 incident.Root cause: the
temp_codec_dirfixture intests/test_agent_plan.py+tests/test_agent_runner.py+tests/test_agent_messaging.pymonkeypatchedcodec_agent_planpaths but NOTcodec_audit._AUDIT_LOG. So when_run_agent/approve_plan/post_messageaudit-emitted during tests, the events bypassed the redirect and hit the production log.Fix: extend the 3
temp_codec_dirfixtures to also redirectcodec_audit._AUDIT_LOG→tmp_path / "audit.log". Verified clean — 91/91 Phase 3 tests still pass, full suite 930/20/73 baseline preserved.2. README refresh
blocked_on_qwendedicated status (Step 9 review C2)Test plan
test_agent_plan.py + test_agent_runner.py + test_agent_messaging.py + test_chat_escalation.py) → 91/91 passedagent_id="test_agent"events from pytest runs going forward🤖 Generated with Claude Code