perf: light PostToolUse hook (perf subset of ac2a001) [follow-up #31]#32
Merged
Conversation
…lter, lock-safe append [follow-up #31] - Add _NOISE_TOOLS frozenset for O(1) skip of high-frequency no-signal tools (TodoRead/Write, WebSearch/Fetch, smem_recall/session/stats/index, preview logs) before any config file I/O — fastest possible exit path - Replace lazy `from surreal_memory.utils.timeutils import utcnow` with inline stdlib datetime.now(UTC) in _format_event — zero non-stdlib imports on hot path - Merge two separate config.toml reads (_is_enabled + _get_blacklist) into one _read_tool_memory_config call per invocation - Lock-safe JSONL append via fcntl.flock(LOCK_EX) on POSIX; plain append fallback on platforms without fcntl (Windows) - Handle CODEX_SESSION_ID as fallback when CLAUDE_SESSION_ID is absent - Extract _get_data_dir() helper; _get_session_id() as testable function - Tests: 48 tests covering _NOISE_TOOLS, _utcnow_iso, _get_session_id (CLAUDE+CODEX), single-config-read API, concurrent append JSONL validity, noise fast-path
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.
Follow-up to merged #31. light PostToolUse hook (perf subset of ac2a001). Local make verify green. See .goal/runs/002-followup-port-2026-06.