@windyroad/architect 0.18.3 → 0.18.4-preview.884
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.
|
@@ -217,6 +217,23 @@ mk_existing_adr() {
|
|
|
217
217
|
[ -f "$(expected_marker "$adr")" ]
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
# P368: genuine cold path — no CLAUDE_SESSION_ID and no announce markers at all.
|
|
221
|
+
# The shim correctly writes zero markers (nothing to key on) but must NOT do so
|
|
222
|
+
# SILENTLY: a loud stderr diagnostic explains why the subsequent discipline-hook
|
|
223
|
+
# deny happens, breaking the confusing "you didn't run the shim" loop the shim's
|
|
224
|
+
# prior silent exit 0 produced. Exit stays 0 (documented contract: do not crash
|
|
225
|
+
# SKILL flows before any hook has fired this session).
|
|
226
|
+
@test "mark-oversight-confirmed.sh emits a loud stderr diagnostic on the no-candidate cold path (P368)" {
|
|
227
|
+
mk_existing_adr "252-coldpath.proposed.md"
|
|
228
|
+
adr="$DIR/docs/decisions/252-coldpath.proposed.md"
|
|
229
|
+
# MARK_DIR is empty (no *-announced-* markers); unset the env SID fast-path too.
|
|
230
|
+
run env -u CLAUDE_SESSION_ID bash "$MARK_SCRIPT" "$adr"
|
|
231
|
+
[ "$status" -eq 0 ] # contract: cold path still exits 0
|
|
232
|
+
[ ! -f "$(expected_marker "$adr")" ] # no marker written
|
|
233
|
+
[[ "$output" == *"no candidate session id"* ]] # loud, not silent
|
|
234
|
+
[[ "$output" == *"P368"* ]]
|
|
235
|
+
}
|
|
236
|
+
|
|
220
237
|
# ── Non-Edit/Write tool calls always exit 0 silently ────────────────────
|
|
221
238
|
|
|
222
239
|
@test "tool_name=Bash exits 0 silently regardless of file path" {
|
|
@@ -12,6 +12,11 @@ setup() {
|
|
|
12
12
|
PLUGIN_ROOT="$REPO_ROOT/packages/architect"
|
|
13
13
|
DIR="$(mktemp -d)"
|
|
14
14
|
mkdir -p "$DIR/docs/decisions"
|
|
15
|
+
# Hermeticity (P391): the AFK work-problems orchestrator exports
|
|
16
|
+
# WR_SUPPRESS_OVERSIGHT_NUDGE=1, which the hook self-suppresses on. Unset it so
|
|
17
|
+
# count-emitting tests assert real behaviour; guard-specific tests set it
|
|
18
|
+
# per-invocation via `run env WR_SUPPRESS_OVERSIGHT_NUDGE=...`.
|
|
19
|
+
unset WR_SUPPRESS_OVERSIGHT_NUDGE
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
teardown() {
|
package/package.json
CHANGED
|
@@ -34,9 +34,10 @@
|
|
|
34
34
|
#
|
|
35
35
|
# Exit codes:
|
|
36
36
|
# 0 — marker(s) written for at least one candidate SID, OR no candidate
|
|
37
|
-
# SID was discoverable (cold
|
|
38
|
-
#
|
|
39
|
-
#
|
|
37
|
+
# SID was discoverable (cold path: no announce markers yet). The latter
|
|
38
|
+
# writes no marker and prints a loud stderr diagnostic (P368) explaining
|
|
39
|
+
# the downstream hook deny, then exits 0 so SKILL flows do not crash
|
|
40
|
+
# before any hook has fired in the session.
|
|
40
41
|
# 2 — bad argument (missing or empty artefact-path).
|
|
41
42
|
#
|
|
42
43
|
# @adr ADR-066 (human-oversight marker)
|
|
@@ -97,10 +98,23 @@ candidates=$(
|
|
|
97
98
|
} | awk 'NF && !seen[$0]++'
|
|
98
99
|
)
|
|
99
100
|
|
|
100
|
-
# No candidate SID — cold path.
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
|
|
101
|
+
# No candidate SID — cold path. Emit a loud stderr diagnostic (P368) and still
|
|
102
|
+
# exit 0. Exit 0 preserves the documented contract (do not crash SKILL flows
|
|
103
|
+
# before any announce marker has fired this session); the diagnostic replaces the
|
|
104
|
+
# prior SILENT no-op, which masqueraded as success and left the caller to hit the
|
|
105
|
+
# oversight-marker-discipline hook's deny with no idea why — the confusing loop
|
|
106
|
+
# P368 documents (the deny points back at this shim, which the caller already ran).
|
|
107
|
+
if [ -z "$candidates" ]; then
|
|
108
|
+
{
|
|
109
|
+
echo "wr-architect-mark-oversight-confirmed: no candidate session id discoverable"
|
|
110
|
+
echo " (CLAUDE_SESSION_ID empty and no *-announced-* markers in ${MARKER_DIR} within ${WINDOW_MINS}min)."
|
|
111
|
+
echo " NO oversight marker was written for: ${ABS_PATH}"
|
|
112
|
+
echo " The oversight-marker-discipline hook will DENY the 'human-oversight: confirmed' Edit"
|
|
113
|
+
echo " until a session announce marker exists. Start a fresh session, or point SESSION_MARKER_DIR"
|
|
114
|
+
echo " at a dir containing a *-announced-<sid> file, then re-run this shim (P368)."
|
|
115
|
+
} >&2
|
|
116
|
+
exit 0
|
|
117
|
+
fi
|
|
104
118
|
|
|
105
119
|
while IFS= read -r sid; do
|
|
106
120
|
[ -n "$sid" ] || continue
|