Draft: feat(minder): record policy matches in the PreToolUse hook
Description
After the PreToolUse hook prints its decision, it now records every policy that matched the tool call in the session's spool. glab minder audit sync then uploads the records to GitLab. If recording fails, the hook still prints the same decision and exits 0. This is part of https://gitlab.com/gitlab-org/gitlab/-/work_items/634683 and is stacked on !4476.
Redaction: the hook records the Bash command or the file path as the agent sent it. It keeps the first 32 KB, replaces common secrets with glab's redaction markers, and then cuts the result to 1 KB. Secrets are replaced before the 1 KB cut, so a secret cut in half cannot leak its first part. MCP tool input is never recorded, only the server and tool names. The command or path is still sent in full, up to 8 KB, with the tool call's own audit event. The copy in this event is only there so the policy match can be read on its own.
How has this been tested?
Unit tests cover the hook writing one record per match, a deny and an ask that match the same call, writing nothing when no policy matches, redaction and the 1 KB cut for long and very long commands, stable event IDs, and the hook printing the same decision when it cannot record. A new benchmark shows no change for calls without a match and about 0.1 ms more for calls with one.