Files
hx/tests/lens_e2e.sh
T
hermes 9b8cf48e21
ci / check (push) Canceled after 0s
M3: lens LSP diagnostics + lsp tool
- seq log: monotonic project/file seq with change source
- minimal LSP JSON-RPC client (no lsp-types): framing, requests with timeout, server->client requests,
  publishDiagnostics with versions, $/progress + rust-analyzer serverStatus busy tracking
- manager: built-in table (rust-analyzer, tsserver, pyright, gopls, clangd), outermost-root detection,
  lazy spawn, idle eviction, crash restart with 2-failure breaker, degradation notes, ContentModified retry,
  session-start warmup, config overrides/disable
- turn-end hook: diagnostics for files changed this turn, errors first, per-file cap, total cap,
  unchanged findings not repeated, one 'no problems' after a fix; agent_end/off modes
- lsp tool: diagnostics, definition, references, hover, symbols
- tests: real rust-analyzer + pyright (skipped if absent); tests/lens_e2e.sh proves an introduced type error
  is surfaced and fixed without prompting

Closes #21, closes #22, closes #23, closes #24, closes #25, closes #26
2026-09-30 10:48:37 +00:00

21 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# Lens e2e: introduced type error is surfaced by rust-analyzer and fixed without prompting.
set -eu
command -v rust-analyzer >/dev/null || { echo "skip: rust-analyzer not installed"; exit 0; }
root=$(cd "$(dirname "$0")/.." && pwd)
tmp=$(mktemp -d)
trap 'kill $srv 2>/dev/null; rm -rf "$tmp"' EXIT
port=$((20000 + $$ % 20000))
python3 "$root/tests/fake_lens.py" $port & srv=$!
mkdir -p "$tmp/home/.hx" "$tmp/repo/src"
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
printf '[package]\nname = "t"\nversion = "0.1.0"\nedition = "2021"\n' > "$tmp/repo/Cargo.toml"
sleep 0.5
export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
cd "$tmp/repo"
HOME="$tmp/home" HX_BASE_URL="http://127.0.0.1:$port" "$root/target/debug/hx" -p "add f" > "$tmp/out" 2> "$tmp/err" || { cat "$tmp/err"; exit 1; }
grep -q "FINISHED lens=clean" "$tmp/out" || { echo "--- out"; cat "$tmp/out"; echo "--- err"; cat "$tmp/err"; exit 1; }
grep -q "42" src/lib.rs
curl -s "http://127.0.0.1:$port/" | grep -q 'mismatched types'
echo "lens e2e ok"