chore: delete code comments, add ratchet lint and ADRs
Classify every comment as tautology, stale, excuse or decision record. Tautology/stale/excuse comments are deleted (excuses filed as issues #196-#236), decisions moved to docs/adr/0001-0034. - scripts/lint-comments.sh + .comment-baseline: per-file comment count may only go down; wired into tests/all.sh - .claude/skills/delete-comment: repeatable audit workflow - cargo fmt applied to touched crates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0545702fe0
commit
a94632ea3d
131 files changed
+1051
-1746
No files matched your search
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# M7 e2e: --mode json emits NDJSON events; examples/rpc_client.py drives a session over --mode rpc;
|
||||
# examples/ext_guard.py (extension) blocks a bash call and provides a tool.
|
||||
set -eu
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
tmp=$(mktemp -d)
|
||||
@@ -18,7 +16,6 @@ start() {
|
||||
}
|
||||
fail() { echo "FAIL: $1"; cat "$2"; exit 1; }
|
||||
|
||||
# 1) json mode: every line parses; tool_call, tool_result, text and done are present
|
||||
start 1
|
||||
"$root/target/debug/hx" -p "go" --mode json > "$tmp/json" 2> "$tmp/err" || fail "json run" "$tmp/err"
|
||||
python3 - "$tmp/json" <<'PY' || fail "ndjson schema" "$tmp/json"
|
||||
@@ -33,7 +30,6 @@ assert any(e["type"] == "tool_result" and "hi from hx" in e["content"] for e in
|
||||
PY
|
||||
kill $srv; rm -f hello.txt
|
||||
|
||||
# 2) rpc mode driven by the example client
|
||||
start 2
|
||||
python3 "$root/examples/rpc_client.py" "$root/target/debug/hx" "go" > "$tmp/rpc" 2> "$tmp/err" || fail "rpc" "$tmp/err"
|
||||
grep -q "Done: file says hi from hx." "$tmp/rpc" || fail "rpc text" "$tmp/rpc"
|
||||
@@ -43,14 +39,12 @@ grep -q "BUSY_CHECK claude-x" "$tmp/rpc" || fail "rpc set_model" "$tmp/rpc"
|
||||
grep -q "COMPLETE 0 \['/model'\]" "$tmp/rpc" || fail "rpc complete" "$tmp/rpc"
|
||||
grep -q "SESSIONS [0-9]* go 6" "$tmp/rpc" || fail "rpc sessions" "$tmp/rpc"
|
||||
grep -q "RESUMED 6 go" "$tmp/rpc" || fail "rpc resume" "$tmp/rpc"
|
||||
# hx -r <query> resumes the matching session (the rpc run above titled it "go")
|
||||
"$root/target/debug/hx" -r go -p "again" > /dev/null 2> "$tmp/err" || true
|
||||
grep -q "\[resuming: go\]" "$tmp/err" || fail "hx -r query" "$tmp/err"
|
||||
"$root/target/debug/hx" -r nomatchzz -p x > /dev/null 2> "$tmp/err" && fail "hx -r no match should fail" "$tmp/err"
|
||||
grep -q "matches \"nomatchzz\"" "$tmp/err" || fail "hx -r no match message" "$tmp/err"
|
||||
kill $srv; rm -f hello.txt
|
||||
|
||||
# 3) extension blocks the bash call (cat) and registers its tool
|
||||
start 3
|
||||
printf '[[extensions]]\ncommand = ["python3", "%s/examples/ext_guard.py", "sed -n p hello"]\n' "$root" >> "$tmp/home/.hx/config.toml"
|
||||
"$root/target/debug/hx" -p "go" --mode json > "$tmp/ext" 2> "$tmp/err" || fail "ext run" "$tmp/err"
|
||||
|
||||
Reference in new issue
Block a user