@windyroad/voice-tone 0.5.8-preview.593 → 0.5.9-preview.598
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.
package/hooks/lib/review-gate.sh
CHANGED
|
@@ -20,7 +20,7 @@ check_review_gate() {
|
|
|
20
20
|
|
|
21
21
|
# 1. Marker must exist
|
|
22
22
|
if [ ! -f "$MARKER" ]; then
|
|
23
|
-
REVIEW_GATE_REASON="No ${SYSTEM} review marker found.
|
|
23
|
+
REVIEW_GATE_REASON="No ${SYSTEM} review marker found. Delegate to wr-${SYSTEM}:agent via the Agent tool (subagent_type: 'wr-${SYSTEM}:agent') so the agent can review and create the marker."
|
|
24
24
|
return 1
|
|
25
25
|
fi
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ check_review_gate() {
|
|
|
30
30
|
local AGE=$(( NOW - MARKER_TIME ))
|
|
31
31
|
if [ "$AGE" -ge "$TTL_SECONDS" ]; then
|
|
32
32
|
rm -f "$MARKER" "$HASH_FILE"
|
|
33
|
-
REVIEW_GATE_REASON="${SYSTEM} review expired (${AGE}s old, TTL ${TTL_SECONDS}s). Re-
|
|
33
|
+
REVIEW_GATE_REASON="${SYSTEM} review expired (${AGE}s old, TTL ${TTL_SECONDS}s). Re-delegate to wr-${SYSTEM}:agent via the Agent tool (subagent_type: 'wr-${SYSTEM}:agent') to refresh the marker."
|
|
34
34
|
return 1
|
|
35
35
|
fi
|
|
36
36
|
|
|
@@ -45,7 +45,7 @@ check_review_gate() {
|
|
|
45
45
|
CURRENT_HASH=$(_substance_hash_path "$POLICY_FILE")
|
|
46
46
|
if [ "$STORED_HASH" != "$CURRENT_HASH" ]; then
|
|
47
47
|
rm -f "$MARKER" "$HASH_FILE"
|
|
48
|
-
REVIEW_GATE_REASON="${SYSTEM} policy file changed since last review. Re-
|
|
48
|
+
REVIEW_GATE_REASON="${SYSTEM} policy file changed since last review. Re-delegate to wr-${SYSTEM}:agent via the Agent tool (subagent_type: 'wr-${SYSTEM}:agent') to refresh the marker."
|
|
49
49
|
return 1
|
|
50
50
|
fi
|
|
51
51
|
fi
|
|
@@ -47,3 +47,35 @@ teardown() {
|
|
|
47
47
|
result=$(echo "test" | _hashcmd)
|
|
48
48
|
[ -n "$result" ]
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
# P215 / RFC-021 — REVIEW_GATE_REASON must carry an explicit recovery
|
|
52
|
+
# directive naming the subagent_type and Agent tool, parallel to the
|
|
53
|
+
# architect-gate ARCHITECT_GATE_REASON shape.
|
|
54
|
+
|
|
55
|
+
@test "REVIEW_GATE_REASON names re-delegate directive when no marker" {
|
|
56
|
+
REVIEW_GATE_REASON=""
|
|
57
|
+
check_review_gate "$TEST_SESSION" "voice-tone" "docs/VOICE-AND-TONE.md" || true
|
|
58
|
+
[[ "$REVIEW_GATE_REASON" == *"wr-voice-tone:agent"* ]]
|
|
59
|
+
[[ "$REVIEW_GATE_REASON" == *"Agent tool"* ]]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@test "REVIEW_GATE_REASON names refresh-the-marker directive when TTL expired" {
|
|
63
|
+
touch "/tmp/voice-tone-reviewed-${TEST_SESSION}"
|
|
64
|
+
REVIEW_GATE_REASON=""
|
|
65
|
+
REVIEW_TTL=0 check_review_gate "$TEST_SESSION" "voice-tone" "docs/VOICE-AND-TONE.md" || true
|
|
66
|
+
[[ "$REVIEW_GATE_REASON" == *"expired"* ]]
|
|
67
|
+
[[ "$REVIEW_GATE_REASON" == *"wr-voice-tone:agent"* ]]
|
|
68
|
+
[[ "$REVIEW_GATE_REASON" == *"refresh the marker"* ]]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@test "REVIEW_GATE_REASON names drift directive when policy hash differs" {
|
|
72
|
+
POLICY_FILE="$TMPDIR_ORIG/VOICE-AND-TONE.md"
|
|
73
|
+
echo "# policy v1" > "$POLICY_FILE"
|
|
74
|
+
touch "/tmp/voice-tone-reviewed-${TEST_SESSION}"
|
|
75
|
+
echo "stale-hash" > "/tmp/voice-tone-reviewed-${TEST_SESSION}.hash"
|
|
76
|
+
REVIEW_GATE_REASON=""
|
|
77
|
+
check_review_gate "$TEST_SESSION" "voice-tone" "$POLICY_FILE" || true
|
|
78
|
+
[[ "$REVIEW_GATE_REASON" == *"changed"* ]] || [[ "$REVIEW_GATE_REASON" == *"drift"* ]]
|
|
79
|
+
[[ "$REVIEW_GATE_REASON" == *"wr-voice-tone:agent"* ]]
|
|
80
|
+
[[ "$REVIEW_GATE_REASON" == *"refresh the marker"* ]]
|
|
81
|
+
}
|