基于 jar-analyzer(SQLite + 内置 MCP)的证据驱动 Java 安全审计技能。核心目标:把“结论”变成“可复现证据 + 可度量覆盖率”。
get_code_cfr/get_code_fernflower)<python> scripts/cli.py <subcommand>(<python> 为 init 输出中检测到的命令)。evidence --mcp-tool-result-file <path>(优先)或 --code-json-file/--code-text-file。<python> scripts/cli.py ... 之前,必须先进入技能根目录。/tmp//var/folders、禁止 find 猜 tool-results、禁止 /dev/stdin/here-doc/echo 注入 JSON;一旦出现 "Do you want to proceed?" / "allow reading from tmp/ …" 立即取消。取证只允许两条路径:--mcp-tool-result-file <Claude 提示的绝对路径> 或把 JSON 写入 runs/<run_id>/inputs/ 再 --code-json-file。verify_*.jsonl。init 命令会自动检测当前系统可用的 Python 命令(优先 python,其次 python3)。init 输出中会显示检测到的 Python 命令,后续所有命令都应使用相同的命令。init 输出 python scripts/cli.py ...,则后续都用 python;如果输出 python3 scripts/cli.py ...,则后续都用 python3。C:\...,说明你在 Windows 环境。--db "C:\target path\db"),避免空格/特殊字符导致解析错误。/home/... 或 /Users/...,说明你在 Unix 环境。init 完成时,立即捕获输出中的 Run ID 和 Python 命令。init 输出中显示的 Python 命令(保持一致)init 输出中显示的命令(包含 --run <ID> 参数)init 命令会在输出中打印下一条完整命令(用 = 分隔线标记),必须完整复制整行命令,不要只复制部分参数。init 输出并完整复制命令。references/TACTICS_LIBRARY.mdget_code_cfr / get_code_fernflower(返回 JSON,含 fullClassCode)get_code_*(不要阅读/解析返回内容;输出过大时系统会自动落盘到 tool-results 文件)<python> scripts/cli.py evidence --mcp-tool-result-file <tool-results/xxx.txt>(<python> 为 init 输出中检测到的命令,自动抽 fullClassCode 并完成切片+hash 落盘)evidence 不会自己去找代码;如果没提供 --mcp-tool-result-file/--code-json-file/--code-text-file,工具会 fail-closed 直接报 “missing code input”runs/<run_id>/inputs/mcp_<candidate_id>.json,然后用 --code-json-file(jar_id,class,method,desc);禁止只用名字 join/追链snippet_ref 或 chain_trace 或 sql_proof,否则拒绝写入--strict 未完成 coverage 直接 fail用 <python> scripts/cli.py(等价 scripts/jaudit.py,<python> 为 init 自动检测的命令):
init:创建 runs/<id>/session.json inventory.json rules/ graph_cache/ ...profile --cwd <jar-analyzer>:写 profile 并快照 vulnerability.yaml/dfs-sink.json 到 runs/<id>/rules/freeze --vector <v> --cwd <jar-analyzer>:圈地+降噪+sink_resolutiongraph→reach --vector <v>:可达性/最短链回写 candidatesnext --vector <v> --limit 5:生成 batch(默认按向量 batch.size,推荐 5);NEEDS_DEEPER 优先evidence --candidate-id <CID> --batch-id <BID> --code-json-file <mcp.json> --auto-fallback:WARN/BAD 自动 expand→methodsubmit --candidate-id <CID> --batch-id <BID> --status VULN|SAFE|NEEDS_DEEPER:严格模式 VULN 需 GOOD 证据report [--strict]:只读编译 audit_report.md(含 Remaining TopK 下一批计划)status:机器可算进度(final=VULN/SAFE;NEEDS_DEEPER 仍算 remaining)你是驾驶员:必须按批次循环,直到满足停止条件才允许 report。
vectors/default_queue.yaml),不要只跑单个向量就下结论。initprofile --cwd <jar-analyzer>graph(每个 run 只需一次)vector 执行:freeze --vector <v> --cwd <jar-analyzer>reach --vector <v>next --vector <v> --limit 5evidence ... --auto-fallback → submit ...next 取下一批,直到:report(必要时 --strict)report。report 不是“结束”,只是“当前台账快照”;如果存在 Remaining TopK,你必须继续循环。