Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

fix: MultiEdit gate bypass — handle edits[].file_path correctly

seto6ed1c643e7b8
diff --git a/scripts/hooks/gateguard-fact-force.js b/scripts/hooks/gateguard-fact-force.js
index 4126c5457..4bbde83e0 100644
--- a/scripts/hooks/gateguard-fact-force.js
+++ b/scripts/hooks/gateguard-fact-force.js
@@ -192,7 +192,7 @@ function run(rawInput) {
const toolName = data.tool_name || '';
const toolInput = data.tool_input || {};
- if (toolName === 'Edit' || toolName === 'MultiEdit' || toolName === 'Write') {
+ if (toolName === 'Edit' || toolName === 'Write') {
const filePath = toolInput.file_path || '';
if (!filePath) {
return rawInput; // allow
@@ -200,14 +200,24 @@ function run(rawInput) {
if (!isChecked(filePath)) {
markChecked(filePath);
- const msg = (toolName === 'Edit' || toolName === 'MultiEdit')
- ? editGateMsg(filePath) : writeGateMsg(filePath);
- return denyResult(msg);
+ return denyResult(toolName === 'Edit' ? editGateMsg(filePath) : writeGateMsg(filePath));
}
return rawInput; // allow
}
+ if (toolName === 'MultiEdit') {
+ const edits = toolInput.edits || [];
+ for (const edit of edits) {
+ const filePath = edit.file_path || '';
+ if (filePath && !isChecked(filePath)) {
+ markChecked(filePath);
+ return denyResult(editGateMsg(filePath));
+ }
+ }
+ return rawInput; // allow
+ }
+
if (toolName === 'Bash') {
const command = toolInput.command || '';