corrections
CI / CI configuration security checks (push) Successful in 6s
CI / Python tests and compilation (push) Failing after 12s
CI / QMD unit tests (push) Skipped
CI / Capabilities and shell quality (push) Successful in 1m50s
CI / Build and inspect generated packages (push) Skipped
CI / Bash integration and installation guards (push) Skipped
CI / Installed client configuration smoke tests (push) Skipped
CI / PowerShell tests on Ubuntu (push) Failing after 7m24s
CI / CI configuration security checks (push) Successful in 6s
CI / Python tests and compilation (push) Failing after 12s
CI / QMD unit tests (push) Skipped
CI / Capabilities and shell quality (push) Successful in 1m50s
CI / Build and inspect generated packages (push) Skipped
CI / Bash integration and installation guards (push) Skipped
CI / Installed client configuration smoke tests (push) Skipped
CI / PowerShell tests on Ubuntu (push) Failing after 7m24s
This commit is contained in:
1 parent
b35e2254b3
commit
c3e22eb902
39 files changed
+246
-151
No files matched your search
@@ -4,7 +4,7 @@ This directory contains registered hooks and optional utilities. They do not byp
|
||||
|
||||
When Flashbang is enabled, both clients register `Stop` (`flashbang`) for finish notifications. Both clients also register `PreCompact` (`Record-Compact`/`record-compact.sh`) and `SessionStart` (`Show-SessionStatePointer`/`show-session-state-pointer.sh`). Codex additionally registers `SessionStart` (`Show-CavemanMode`/`show-caveman-mode.sh`), which prints the installed Caveman skill so caveman style is always on, as the Claude plugin's own hook does. PreCompact records its timestamp under the installed configuration root. Both session hooks point to an existing workspace `.ai-session/state.json`, using event `cwd` or the process working directory. The main agent owns that state; hooks never write it or print its contents. Missing state is a successful no-op.
|
||||
|
||||
Both clients register `PreToolUse` (`Validate-CommandSafety`/`validate-command-safety.sh`), which blocks clearly destructive shell commands by exiting 2; it parses command text, so it is a guard rail rather than a security boundary, and it fails open. Both clients also register `Stop` (`Check-CompletionEvidence`/`check-completion-evidence.sh`) and `UserPromptSubmit` (`Show-CorrectionPrompt`/`show-correction-prompt.sh`). Both call `agent-guards.py`, store nothing, and fail open. The first pushes back once on a completion claim without a named check while non-prose changes exist; the second asks the agent to propose a durable rule after a likely correction. A second `PreToolUse` hook (`Show-SearchReminder`/`show-search-reminder.sh`, also through `agent-guards.py`) reminds the agent to run `semantic-search` before the first open search and again after every 10 open searches without `qmd-search.mjs`, which also covers context lost to compaction; it never blocks, stays silent while the session keeps using `qmd-search.mjs`, does nothing unless QMD is installed, and keeps only hashed per-session markers under `~/.my-ai-configuration/state/search-reminder/`.
|
||||
Both clients register `PreToolUse` (`Validate-CommandSafety`/`validate-command-safety.sh`), which blocks clearly destructive shell commands by exiting 2; it parses command text, so it is a guard rail rather than a security boundary, and it fails open. Both clients also register `Stop` (`Check-CompletionEvidence`/`check-completion-evidence.sh`) and `UserPromptSubmit` (`Show-CorrectionPrompt`/`show-correction-prompt.sh`). Both call `agent-guards.py`, store nothing, and fail open. The first pushes back once on a completion claim without a named check while non-prose changes exist; the second asks the agent to propose a durable rule after a likely correction. The command-safety hook also runs the search reminder from `agent-guards.py` in the same process for shell commands, and Claude registers a second `PreToolUse` hook (`Show-SearchReminder`/`show-search-reminder.sh`) for `Grep` and `Glob`. The reminder the agent to run `semantic-search` before the first open search and again after every 10 open searches without `qmd-search.mjs`, which also covers context lost to compaction; it never blocks, stays silent while the session keeps using `qmd-search.mjs`, does nothing unless QMD is installed, and keeps only hashed per-session markers under `~/.my-ai-configuration/state/search-reminder/`.
|
||||
|
||||
`Invoke-PostChangeVerification`/`invoke-post-change-verification.sh` is not registered or invoked automatically; it runs the repository build only when explicitly invoked. Python-based hooks resolve their interpreter through `Resolve-Python.ps1`/`resolve-python.sh` and are silently skipped without Python 3.11+. `Test-SessionConfig`/`test-session-config.sh` checks repository inputs during a build.
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ command text and cannot see what scripts, aliases, or variables expand to at run
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
import ntpath
|
||||
import os
|
||||
@@ -250,9 +251,22 @@ def run_hook(data, shell_override=None):
|
||||
if reason:
|
||||
print(f'Blocked by command-safety hook: {reason}. Ask the user to run this command themselves if it is intended.', file=sys.stderr)
|
||||
return 2
|
||||
remind_search(event)
|
||||
return 0
|
||||
|
||||
|
||||
def remind_search(event):
|
||||
# Runs the search reminder in this process so shell calls start one hook process, not two.
|
||||
# Best effort like agent-guards.py itself: a reminder failure never blocks or fails the command.
|
||||
try:
|
||||
spec = importlib.util.spec_from_file_location('agent_guards', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'agent-guards.py'))
|
||||
guards = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(guards)
|
||||
guards.remind_search(event)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def run_check(command, workspace):
|
||||
reason = find_violation(command)
|
||||
if reason:
|
||||
|
||||
Reference in new issue
Block a user