@windyroad/architect 0.15.4 → 0.15.5
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.
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Architecture - PostToolUse:Agent|Bash slide-marker hook (P111).
|
|
2
|
+
# Architecture - PostToolUse:Agent|Bash|Skill slide-marker hook (P111 + P213).
|
|
3
3
|
# Slides the parent session's existing architect-reviewed marker forward on
|
|
4
4
|
# subprocess return, treating subprocess wall-clock as continuous parent-
|
|
5
5
|
# session work for TTL purposes. Only TOUCHES an existing marker — never
|
|
6
6
|
# creates one (creation requires a real architect review parsed from the
|
|
7
7
|
# agent's verdict text in architect-mark-reviewed.sh).
|
|
8
8
|
#
|
|
9
|
-
# This addresses P111 / ADR-009 "Subprocess-boundary refresh": Agent
|
|
10
|
-
# tool calls that wrap long-running subprocesses (other subagents,
|
|
11
|
-
# -p` iteration subprocesses, run_in_background completions
|
|
12
|
-
#
|
|
13
|
-
#
|
|
9
|
+
# This addresses P111 / ADR-009 "Subprocess-boundary refresh": Agent, Bash,
|
|
10
|
+
# and Skill tool calls that wrap long-running subprocesses (other subagents,
|
|
11
|
+
# `claude -p` iteration subprocesses, run_in_background completions, or
|
|
12
|
+
# /wr-*:assess-* sibling-assessor SKILLs run by the AFK orchestrator) would
|
|
13
|
+
# otherwise let the parent's marker age past TTL even though the parent is
|
|
14
|
+
# still actively working through the subprocess. The Skill matcher coverage
|
|
15
|
+
# is the 2026-06-08 P213 amendment (Option D).
|
|
14
16
|
#
|
|
15
17
|
# Failed subprocesses (tool_response.is_error=true) do NOT extend the trust
|
|
16
18
|
# window — see slide_marker_on_subprocess_return in lib/gate-helpers.sh.
|
package/hooks/hooks.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"PostToolUse": [
|
|
16
16
|
{ "matcher": "Agent", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/architect-mark-reviewed.sh" }] },
|
|
17
17
|
{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/architect-refresh-hash.sh" }] },
|
|
18
|
-
{ "matcher": "Agent|Bash", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/architect-slide-marker.sh" }] }
|
|
18
|
+
{ "matcher": "Agent|Bash|Skill", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/architect-slide-marker.sh" }] }
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -76,3 +76,17 @@ _backdate() {
|
|
|
76
76
|
AGE=$((NOW - AFTER))
|
|
77
77
|
[ "$AGE" -lt 5 ]
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
@test "hook: P213 — slides on Skill tool_name (Agent|Bash|Skill matcher expansion)" {
|
|
81
|
+
# Confirms hooks.json matcher expansion (Agent|Bash → Agent|Bash|Skill)
|
|
82
|
+
# composes correctly with the existing hook script. The hook script does
|
|
83
|
+
# not filter on tool_name; the matcher in hooks.json gates which tool
|
|
84
|
+
# completions fire the script. This test asserts the script handles the
|
|
85
|
+
# Skill-shaped tool_response identically to Agent|Bash.
|
|
86
|
+
touch "$REVIEW_MARKER"
|
|
87
|
+
_backdate "$REVIEW_MARKER" 60
|
|
88
|
+
BEFORE=$(stat -c%Y "$REVIEW_MARKER" 2>/dev/null || /usr/bin/stat -f%m "$REVIEW_MARKER")
|
|
89
|
+
echo '{"session_id":"'"$TEST_SESSION"'","tool_name":"Skill","tool_input":{"skill":"wr-risk-scorer:assess-release"},"tool_response":{"content":[{"type":"text","text":"OK"}]}}' | "$HOOK"
|
|
90
|
+
AFTER=$(stat -c%Y "$REVIEW_MARKER" 2>/dev/null || /usr/bin/stat -f%m "$REVIEW_MARKER")
|
|
91
|
+
[ "$AFTER" -gt "$BEFORE" ]
|
|
92
|
+
}
|
|
@@ -98,3 +98,21 @@ _backdate() {
|
|
|
98
98
|
# Fail-safe: when the hook input cannot be parsed, treat as error and skip
|
|
99
99
|
[ "$BEFORE" = "$AFTER" ]
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
@test "slide: triggers correctly on Skill tool_response shape (P213, ADR-009 2026-06-08 amendment)" {
|
|
103
|
+
# hooks.json matcher expansion Agent|Bash → Agent|Bash|Skill (P213 Option D)
|
|
104
|
+
# widens slide-marker coverage to PostToolUse:Skill completions (e.g. the
|
|
105
|
+
# /wr-risk-scorer:assess-* sibling assessor SKILLs run as long subprocesses
|
|
106
|
+
# by the AFK orchestrator). The Skill tool_response shape is identical to
|
|
107
|
+
# Agent|Bash (Claude Code's uniform PostToolUse contract), so the matcher-
|
|
108
|
+
# agnostic helper composes without code changes. This test documents that
|
|
109
|
+
# contract explicitly so a future hook_input shape divergence regression
|
|
110
|
+
# surfaces here rather than at the gate-denial site.
|
|
111
|
+
touch "$MARKER"
|
|
112
|
+
_backdate "$MARKER" 60
|
|
113
|
+
BEFORE=$(_mtime "$MARKER")
|
|
114
|
+
_HOOK_INPUT='{"tool_name":"Skill","tool_response":{"content":[{"type":"text","text":"OK"}]}}'
|
|
115
|
+
slide_marker_on_subprocess_return "$MARKER"
|
|
116
|
+
AFTER=$(_mtime "$MARKER")
|
|
117
|
+
[ "$AFTER" -gt "$BEFORE" ]
|
|
118
|
+
}
|