You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Record mcp__ci__edit_context / mcp__ci__diff_impact calls as they happen —
77
106
# recorded on PreToolUse (before the call runs) since attempting the check is
78
107
# what matters here, and PreToolUse is all that's needed to observe it.
@@ -103,9 +132,19 @@ case "$tool_name" in
103
132
nudge 'MANDATORY per AGENTS.md Stage 5 — call mcp__ci__edit_context(symbol) before this write if it modifies existing code, never skip (especially if is_hub).'
104
133
;;
105
134
Bash)
106
-
if grep -qE '\bgit[[:space:]]+(commit|push)\b'<<<"$command";then
135
+
# Broad on purpose: `git -C <dir> commit` / `git --git-dir=<dir> push` put
136
+
# flags between the subcommand and "commit"/"push", so a tight
137
+
# `git commit` adjacency check misses them entirely (a false negative —
138
+
# worse than the false positive this file otherwise guards against).
139
+
# resolve_git_target_root() + the scope check below is what keeps this
140
+
# broad match from over-firing on unrelated repos.
141
+
if grep -qE '\bgit\b.*\b(commit|push)\b'<<<"$command";then
107
142
if [ "$needs_diff_impact"="true" ];then
108
-
deny 'MANDATORY per AGENTS.md Stage 7 — call mcp__ci__diff_impact(staged=true) before this commit/push, never skip. Files changed since the last diff_impact check.'
if [ -z"$target_root" ] || [ "$target_root"="$project_root" ];then
146
+
deny 'MANDATORY per AGENTS.md Stage 7 — call mcp__ci__diff_impact(staged=true) before this commit/push, never skip. Files changed since the last diff_impact check.'
**Done when**: `aggregate_risk == "low"` and `unindexed_files== []`. Safe to commit.
156
+
**Done when**: `aggregate_risk == "low"` and no `unindexed_files` entry has `reason == "pending_scan"`. Safe to commit.
157
157
158
158
**Signals**:
159
159
-`aggregate_risk == "critical"` or `"high"` → call `callers` on `affected_symbols[0]` to verify manually
160
-
-`aggregate_risk == "unknown"` → unindexed files present; wait for index to reach `ready`
161
-
-`unindexed_files non-empty` → index incomplete; DO NOT treat diff as safe to push
160
+
-`aggregate_risk == "unknown"` → a `pending_scan` file is present; wait for index to reach `ready`, then retry
161
+
-`unindexed_files[].reason == "pending_scan"` → that file's index is stale/missing; DO NOT treat diff as safe to push yet
162
+
-`unindexed_files[].reason == "out_of_scope"` → not a source file (docs/config/etc.); permanent, harmless, does not affect `aggregate_risk`
162
163
-`suggested_reviewers` present → notify these owners before merging
163
164
164
165
**Rule: Never commit or push** without calling `diff_impact` first. Under Claude Code with this repo's bundled hook (`.claude/hooks/ci-nudge.sh`), this is enforced: `git commit`/`git push` is denied whenever a file was edited since the last `diff_impact` call.
0 commit comments