Skip to content

chore: session-infra hardening — command-guard hook (pkill -f/force-push denied) + orphan-spec server-leak fix - #522

Merged
alicoding merged 2 commits into
mainfrom
fix/orphan-test-server-leak
Aug 29, 2026
Merged

chore: session-infra hardening — command-guard hook (pkill -f/force-push denied) + orphan-spec server-leak fix#522
alicoding merged 2 commits into
mainfrom
fix/orphan-test-server-leak

Conversation

@alicoding

@alicoding alicoding commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Two session-infrastructure changes (goal 0191's evidence bar — hooks only for problems that actually occurred):

  1. PreToolUse command guard (scripts/hook-command-guard.sh): the two never-granted command families move from prose to deterministic denies — pkill -f/killall (a broad pkill once killed the production mill-server LaunchAgent) and git push --force[-with-lease]/-f + filter-branch/filter-repo (CLAUDE.md's standing never). Same fail-open/exit-2 contract as hook-build-guard.sh; patterns anchor to command-segment starts so commit messages mentioning the words never false-positive. A 16-case deny/pass matrix ran against the script and caught two regex false negatives before wiring. commit --amend/plain git rebase deliberately stay judgement (the rule's own 'without being explicitly asked', and the pr-shepherd's instructed rebases are a legal flow). Shopping trip done per the goal's adopt-first rule: community collections exist but ship generic rm-rf blockers, not this repo's policy — the deny mechanism itself is the officially documented PreToolUse contract the repo already carries.
  2. Orphan-spec server leak: the two-server test from fix: a plugin's objects survive its removal visibly, and its tool joins the palette (0249/0251 audit riders) #521 stopped its second server only after assertions — a mid-test failure leaked the fixed port into the retry, whose bind error then masked the real failure. Servers now tracked and stopped in finally.

🤖 Generated with Claude Code

https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq

…t failure no longer leaks the port into the retry

Regression class: a dedicated-port server stopped only after its
assertions leaks on test timeout, and the retry's bind failure then
masks the real error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq
@alicoding
alicoding enabled auto-merge (squash) August 29, 2026 20:10
…tory-rewrite are hook-denied (goal 0191)

The two never-granted command families with real incidents behind them
(a broad pkill killed the production mill-server; force-push is
CLAUDE.md's standing never) move from prose to a deterministic deny:
scripts/hook-command-guard.sh, same fail-open/exit-2 contract as
hook-build-guard.sh. Patterns anchor to command-segment starts so a
commit message MENTIONING these words never false-positives; a 16-case
matrix (8 deny / 8 pass) was run against the script and caught two
regex false negatives before wiring. amend/plain-rebase stay judgement
(the rule's own 'without being explicitly asked' makes a hard deny
wrong, and the pr-shepherd's instructed rebases are a legal flow).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq
@alicoding alicoding changed the title test: the orphan-object spec stops its servers in finally (retry port-leak class) chore: session-infra hardening — command-guard hook (pkill -f/force-push denied) + orphan-spec server-leak fix Aug 29, 2026
@alicoding
alicoding merged commit c7df6ab into main Aug 29, 2026
30 checks passed
@alicoding
alicoding deleted the fix/orphan-test-server-leak branch August 29, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant