fix(hooks): route file-indexed probe through daemon socket so hard-de…#193
Merged
Merged
Conversation
zzet
approved these changes
Jun 29, 2026
Owner
|
@vitaliyslion thank you for your contribution! I'll take a look at TODOs performance references later |
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
The PreToolUse hook is meant to hard-deny whole-file
Read/cat/Edit/Writeof indexed source and redirect to graph tools. Commit
7208e77a("server: drop--web, salvage /v1/graph + /v1/events, delete internal/web", 2026-04-18) deleted
the
internal/webserver, removing the/api/graph/fileendpoint the hookprobed. Since then
queryFileIndexedalways returned(false, 0), so the denysilently degraded to soft guidance for every agent. Masked because the tests
mocked the endpoint and the fallback still printed advice.
This re-points the file-indexed probe at the daemon's MCP socket
(
get_file_summary) - the always-present, authoritative graph owner.Changes
/api/graph/fileHTTP probe with a daemon socket call toget_file_summary, behind afileIndexedFntest seam.cwd(fromHookInput.CWD) throughenrich -> enrichRead/enrichBash/ enrichEdit/enrichWrite -> queryFileIndexedso the probe scopes to the workspaceand resolves the repo-relative graph key.
postGlobmakes ~onecontrol-status round-trip instead of one per file.
through the server's existing
resolveFilePath(abs -> repo-relative + symlinkconfinement) instead of hand-rolling root resolution; reuse one MCP connection
per batch / count-only probe. Note: the
file-callers+symbol-atprobes inposttooluse.gowere never served — out of scope here.Testing
go test -race ./...)Checklist
Meta["methods"]for interfaces (if applicable)EdgeMemberOfedges to their containing type (if applicable)