@windyroad/risk-scorer 0.11.0-preview.393 → 0.11.1-preview.396
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -233,7 +233,7 @@ fi
|
|
|
233
233
|
# EXTERNAL_COMMS_LEAK_PREFILTER=yes (risk) or =no (voice-tone).
|
|
234
234
|
if [ "$EXTERNAL_COMMS_LEAK_PREFILTER" = "yes" ]; then
|
|
235
235
|
if ! leak_detect_scan "$DRAFT"; then
|
|
236
|
-
REASON=$(printf 'BLOCKED (external-comms gate / %s evaluator): %s on %s. Remove the leak before retrying. Override only if intentional: BYPASS_RISK_GATE=1.' \
|
|
236
|
+
REASON=$(printf 'BLOCKED (external-comms gate / %s evaluator): %s on %s. Remove the leak before retrying. Override only if intentional (pre-session env): BYPASS_RISK_GATE=1.' \
|
|
237
237
|
"$EXTERNAL_COMMS_EVALUATOR_ID" "$LEAK_DETECT_REASON" "$SURFACE")
|
|
238
238
|
deny_with_reason "$REASON"
|
|
239
239
|
exit 0
|
|
@@ -261,7 +261,7 @@ fi
|
|
|
261
261
|
# PostToolUse mark hook can derive the canonical marker key locally
|
|
262
262
|
# (sha256(DRAFT + '\n' + SURFACE)). Single fire per gate cycle.
|
|
263
263
|
VERDICT_PREFIX="${EXTERNAL_COMMS_VERDICT_PREFIX:-EXTERNAL_COMMS_${EXTERNAL_COMMS_EVALUATOR_ID^^}}"
|
|
264
|
-
REASON=$(printf 'BLOCKED (external-comms gate / %s evaluator): %s draft has not been reviewed by %s. Delegate to %s (subagent_type: '"'"'%s'"'"') with a prompt that starts with the line `SURFACE: %s` and wraps the draft body verbatim inside `<draft>...</draft>` markers (for the changeset-author surface the body is the changeset summary WITHOUT the leading `---` frontmatter block — the gate strips frontmatter before hashing the marker key). The PostToolUse hook derives the marker key from that structure and marks the draft reviewed when the subagent emits %s_VERDICT: PASS — single fire suffices. Use %s for an interactive walkthrough. Override only when intentional: BYPASS_RISK_GATE=1.' \
|
|
264
|
+
REASON=$(printf 'BLOCKED (external-comms gate / %s evaluator): %s draft has not been reviewed by %s. Delegate to %s (subagent_type: '"'"'%s'"'"') with a prompt that starts with the line `SURFACE: %s` and wraps the draft body verbatim inside `<draft>...</draft>` markers (for the changeset-author surface the body is the changeset summary WITHOUT the leading `---` frontmatter block — the gate strips frontmatter before hashing the marker key). The PostToolUse hook derives the marker key from that structure and marks the draft reviewed when the subagent emits %s_VERDICT: PASS — single fire suffices. Use %s for an interactive walkthrough. Override only when intentional (pre-session env): BYPASS_RISK_GATE=1.' \
|
|
265
265
|
"$EXTERNAL_COMMS_EVALUATOR_ID" "$SURFACE" "$EXTERNAL_COMMS_SUBAGENT_TYPE" "$EXTERNAL_COMMS_SUBAGENT_TYPE" "$EXTERNAL_COMMS_SUBAGENT_TYPE" "$SURFACE" "$VERDICT_PREFIX" "$EXTERNAL_COMMS_ASSESS_SKILL")
|
|
266
266
|
deny_with_reason "$REASON"
|
|
267
267
|
exit 0
|
|
@@ -89,6 +89,18 @@ run_hook() {
|
|
|
89
89
|
[[ "$output" == *"wr-risk-scorer:external-comms"* ]]
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
# P173: the BYPASS_RISK_GATE override is clarified as pre-session — it only
|
|
93
|
+
# takes effect when set in Claude Code's process env before the session
|
|
94
|
+
# started, not via a mid-session Bash export. The in-flight escape-hatch is
|
|
95
|
+
# delegation to the external-comms subagent (already named in the deny).
|
|
96
|
+
@test "P173 marker-absent deny clarifies the env override is pre-session" {
|
|
97
|
+
INPUT=$(build_bash_input "gh issue create --title T --body 'we observed a build failure on Node 20'")
|
|
98
|
+
run_hook "$INPUT"
|
|
99
|
+
[ "$status" -eq 0 ]
|
|
100
|
+
[[ "$output" == *"deny"* ]]
|
|
101
|
+
[[ "$output" == *"pre-session"* ]]
|
|
102
|
+
}
|
|
103
|
+
|
|
92
104
|
@test "hard-fail credential pattern (GitHub token) denies immediately with leak reason" {
|
|
93
105
|
INPUT=$(build_bash_input "gh issue comment 42 --body 'token=${GH_TOKEN_LIKE}'")
|
|
94
106
|
run_hook "$INPUT"
|
package/package.json
CHANGED