verify

GitHub

提供 jlens-qwen36 项目端到端验证指南,涵盖启动服务端、使用 Playwright 无头驱动 UI 及执行聊天、干预搜索和 A/B 对比等测试流程。

.claude/skills/verify/SKILL.md WeZZard/jlens-qwen36

Trigger Scenarios

需要验证前端 UI 与服务端交互 执行端到端自动化测试 检查模型干预功能是否正常

Install

npx skills add WeZZard/jlens-qwen36 --skill verify -g -y
More Options

Non-standard path

npx skills add https://github.com/WeZZard/jlens-qwen36/tree/main/.claude/skills/verify -g -y

Use without installing

npx skills use WeZZard/jlens-qwen36@verify

指定 Agent (Claude Code)

npx skills add WeZZard/jlens-qwen36 --skill verify -a claude-code -g -y

安装 repo 全部 skill

npx skills add WeZZard/jlens-qwen36 --all -g -y

预览 repo 内 skill

npx skills add WeZZard/jlens-qwen36 --list

SKILL.md

Frontmatter
{
    "name": "verify",
    "description": "Build\/launch\/drive recipe for verifying jlens-qwen36 UI and server changes end-to-end in a real headless browser."
}

Verify jlens-qwen36 changes

Launch the server

JLENS_PATH=data/lens/qwen36_27b_neuronpedia_n1000.npz \
  uv run python -m uvicorn jlens_qwen.serve:app --host 127.0.0.1 --port 8765

Poll GET /api/lens until it answers and confirm "n_prompts": 1000 before interpreting any result (project rule; startup takes ~30–60 s).

Drive the UI headlessly

The repo has no Node dependency tree. The Playwright MCP server needs Google Chrome, which is not installed — use a Node driver with a cached Chromium instead, following scripts/e2e_intervention_playwright.cjs:

# Find a usable playwright install (npx cache works):
for d in ~/.npm/_npx/*/node_modules; do [ -d "$d/playwright" ] && echo "$d"; done
# Pick one whose chromium exists:
NODE_PATH=<dir> node -e "console.log(require('playwright').chromium.executablePath())"

NODE_PATH=<dir> node your-driver.cjs   # chromium.launch({ headless: true })

Driver facts that hold for web/index.html (single classic script):

  • Top-level bindings (state, _wish, $, addIntervention, rerunWithInterventions, setActiveVariant, …) are reachable from page.evaluate even when declared with let/const.
  • Send a chat turn: click #chat-editor, type, press Enter; then poll !state.streaming && state.messages.at(-1).tokens.length > 0. One short turn takes ~60–90 s (27B model + per-token lens readouts).
  • Backward-search (wish) flow: click a reply token (#chat-log .tok, e.g. hasText 'Paris'), fill #wish-input, press Enter. Search requests go to /api/intervention_search_adaptive; candidate replays advance roughly one per second.
  • A real intervened A/B rerun: addIntervention({... mode: 'swap', token: ' Paris', target: ' Beijing', alpha: 1, layers: [52], scope: { type: 'at', pos: firstGeneratedPos() - 1 } ...}) then rerunWithInterventions(). The server resolves token text to ids.

Flows worth driving

  • Clean baseline chat → wish search starts (progress track, stats, pause button, recipes pill "N tested · search running").
  • Dirty baseline (applied or enabled interventions) → wish refusal modal, no search state, no /api/intervention_search_adaptive POST.
  • A/B compare: variant toggle labels (Baseline/Run A + config label), switching variants with setActiveVariant(false|true).

Gotchas

  • Check the uvicorn log for exactly the requests you expect; refusals and client-side guards send nothing.
  • state.appliedInterventions is frozen per run; only a fresh clean run, clearState(), or switching to a clean variant empties it.

Version History

  • 745a3a8 Current 2026-07-22 11:06

Metadata

Files
0
Version
745a3a8
Hash
8703a956
Indexed
2026-07-22 11:06

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-03 18:47
浙ICP备14020137号-1 $Гость$