Found while mirroring this hook into objectstack for objectstack-ai/objectstack#5742 (PR objectstack-ai/objectstack#6632). Filed here rather than fixed, because it is this repo's file and the mirroring card's fence is the objectstack side.
What
.claude/hooks/guard-shared-stash.sh:49 at origin/main says:
# Self-test (26 cases, no network, no build): .claude/hooks/guard-shared-stash.selftest.sh
The self-test actually carries 32 cases: 30 expect lines plus two inline special cases (the empty-tool_input fail-open case and the no-jq-on-PATH fallback case).
Measured on origin/main:
$ git show origin/main:.claude/hooks/guard-shared-stash.selftest.sh | grep -c '^expect '
30
$ git show origin/main:.claude/hooks/guard-shared-stash.sh | grep -n 'Self-test ('
49:# Self-test (26 cases, no network, no build): .claude/hooks/guard-shared-stash.selftest.sh
32 is also the number the objectui#3430 acceptance comment records ("32 例矩阵 + 反向验证"), so the count in the header appears to have been written from an earlier draft of the matrix and never re-read.
Impact
Observation-class: nothing a user or an agent hits at runtime. The hook's behaviour is correct and the self-test passes. The cost is that the header is the one place a reader checks before trusting the guard's coverage, and it understates it by six cases — the same "declared ≠ actual" shape the hook family exists to police, one layer up in the documentation.
Fix
One line: make it 32. Ideally the count is derived rather than hand-kept (the self-test already prints N passed, N failed), but a hand-kept number that is re-read when the matrix changes is fine at this size.
Note for whoever picks this up
The objectstack mirror (objectstack-ai/objectstack#6632) states 32, verified by running it there (32 passed, 0 failed). If the two repos' copies are meant to stay case-for-case identical — and the hook headers on both sides say they are — fixing this line also removes the only textual difference in that header beyond the deliberate localisations.
Generated by Claude Code
Found while mirroring this hook into objectstack for objectstack-ai/objectstack#5742 (PR objectstack-ai/objectstack#6632). Filed here rather than fixed, because it is this repo's file and the mirroring card's fence is the objectstack side.
What
.claude/hooks/guard-shared-stash.sh:49atorigin/mainsays:The self-test actually carries 32 cases: 30
expectlines plus two inline special cases (the empty-tool_inputfail-open case and the no-jq-on-PATH fallback case).Measured on
origin/main:32 is also the number the objectui#3430 acceptance comment records ("32 例矩阵 + 反向验证"), so the count in the header appears to have been written from an earlier draft of the matrix and never re-read.
Impact
Observation-class: nothing a user or an agent hits at runtime. The hook's behaviour is correct and the self-test passes. The cost is that the header is the one place a reader checks before trusting the guard's coverage, and it understates it by six cases — the same "declared ≠ actual" shape the hook family exists to police, one layer up in the documentation.
Fix
One line: make it
32. Ideally the count is derived rather than hand-kept (the self-test already printsN passed, N failed), but a hand-kept number that is re-read when the matrix changes is fine at this size.Note for whoever picks this up
The objectstack mirror (objectstack-ai/objectstack#6632) states 32, verified by running it there (
32 passed, 0 failed). If the two repos' copies are meant to stay case-for-case identical — and the hook headers on both sides say they are — fixing this line also removes the only textual difference in that header beyond the deliberate localisations.Generated by Claude Code