v1.1.0: routing single source of truth + regression benchmark + supply-chain pins + opencode integration - #43
Conversation
…tion + supply-chain pins - routing: skills/config/routing.json becomes the single source of truth; master-route.ps1 reads it (must/mustAll/exclude semantics); hardcoded routing tables removed; 20+ benchmark-driven keyword coverage fixes - tests: skills/tests/routing-benchmark.json (162 bilingual cases) + test-routing.ps1 runner; CI (windows+ubuntu matrix) runs regression, coherence, smoke, INDEX drift and JSON validation - supply chain: verify pin gate fails unpinned auto-install; pinned frida-tools 14.10.4, pwntools 4.15.0, agent-browser 0.31.1, ida-pro-mcp/proxycat/seclists @commit, nuclei v3.9.0 - global injection: opt-in install-global.ps1 (standalone files) + uninstall-global.ps1/.sh (zero residue); RULES/RULES_zh updated - opencode: opencode.jsonc (42 skills + MCP registry), AGENTS.md, .opencode/agent/reverse-router.md, install-opencode.ps1 - nav: skills/INDEX.md generated by extract-summaries.ps1 - docs: README/CHANGELOG/VERSION 1.1.0, examples/ctf-demo walkthrough - fix: normalize 3 upstream mixed-CRLF markdown files
…llback, BOM for star-history - ci.yml: trigger CI on all branches (fork improve branch was never tested) - extract-summaries.ps1: write LF output + normalize EOL in -Check so it passes under core.autocrlf=true worktrees (GitHub Windows runner) - master-route.ps1: fall back safely if priority contains a ghost route id - install-global.ps1: complete the Claude Code @include hint with full path - update-star-history.ps1: add UTF-8 BOM for PowerShell 5.1 CJK
There was a problem hiding this comment.
Pull request overview
This PR delivers the v1.1.0 upgrade to the repo’s routing system by moving routing rules into a single structured source of truth, adding a regression benchmark/CI enforcement layer, tightening supply-chain pinning guarantees, and adding opt-in global routing + opencode integration.
Changes:
- Centralize PRIMARY routing rules into
skills/config/routing.json, and updatemaster-route.ps1+ verification tooling to consume it. - Add routing regression benchmark + runner (
routing-benchmark.json,test-routing.ps1) and wire them into CI (Windows + Ubuntu). - Add opt-in global routing install/uninstall scripts and opencode configuration/agent entrypoints.
Reviewed changes
Copilot reviewed 32 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Bump version to 1.1.0. |
| skills/tests/routing-benchmark.json | Adds 162-case bilingual routing regression benchmark. |
| skills/scripts/verify-routing-coherence.ps1 | Verifies routing/config artifacts and enforces supply-chain pinning. |
| skills/scripts/update-star-history.ps1 | Encoding/header adjustment (BOM). |
| skills/scripts/uninstall-global.sh | Adds *nix uninstaller for global routing injection artifacts. |
| skills/scripts/uninstall-global.ps1 | Adds PowerShell uninstaller for global routing injection artifacts. |
| skills/scripts/test-routing.ps1 | Adds routing regression runner script. |
| skills/scripts/smoke.ps1 | Extends smoke script coverage to include new scripts. |
| skills/scripts/master-route.ps1 | Switches routing to JSON single source of truth; removes hardcoded maps. |
| skills/scripts/install-opencode.ps1 | Adds opencode install/check helper (CLI/config/frontmatter checks). |
| skills/scripts/install-global.ps1 | Adds explicit opt-in global routing injection installer. |
| skills/scripts/extract-summaries.ps1 | Generates skills/INDEX.md from SKILL frontmatter; supports -Check. |
| skills/scripts/bootstrap-manifest.json | Pins tool versions/commits and adds pin policy metadata. |
| skills/reverse-engineering/dsl-vm-reverse/SKILL.md | Adds missing frontmatter (name/description). |
| skills/pentest-tools/src-hunter/references/playbooks/http-smuggling.md | EOL/format normalization in reference content. |
| skills/pentest-tools/src-hunter/references/payloader/by-category/web/请求走私.md | EOL/format normalization in reference content. |
| skills/INDEX.md | Adds generated skills navigation index. |
| skills/config/routing.json | Introduces routing.json single source of truth (R0–R39). |
| skills/config/global-routing-template.md | Template used by global routing injection installer. |
| RULES.md | Updates rules to require explicit opt-in for global injection. |
| RULES_zh.md | Chinese rules update mirroring explicit opt-in global injection. |
| README.md | Documents new routing artifacts, tests, and opencode integration. |
| opencode.jsonc | Adds opencode project config (skills.paths + MCP registry disabled-by-default). |
| kali/scripts/bootstrap-manifest.json | Adds/preserves pins in Kali manifest and reformats JSON. |
| examples/ctf-demo/workitems.md | Adds example workitems for the demo case. |
| examples/ctf-demo/timeline.md | Adds example timeline for the demo case. |
| examples/ctf-demo/scope.md | Adds example scope gate document for the demo case. |
| examples/ctf-demo/report/report.md | Adds example final report output. |
| examples/ctf-demo/README.md | Adds walkthrough README for the demo case. |
| examples/ctf-demo/evidence/E-001-E-003.md | Adds example evidence chain artifacts. |
| CHANGELOG.md | Adds 1.1.0 changelog entry. |
| AGENTS.md | Adds opencode project entry guidance for this repo. |
| .opencode/agent/reverse-router.md | Adds opencode subagent for routing-only triage. |
| .github/workflows/ci.yml | Adds CI: routing regression, coherence/pin gate, smoke, INDEX drift, JSON validation, sh syntax. |
Suppressed comments (5)
skills/scripts/master-route.ps1:119
- OutDir construction embeds backslashes in path segments (e.g.,
work\master-route-...). On non-Windows, this can create directories containing a literal backslash instead of nesting folders. Build paths with Join-Path per segment for cross-platform behavior.
if ($packageRoot -and (Test-Path -LiteralPath $packageRoot)) {
$OutDir = Join-Path $packageRoot ("work\master-route-{0}" -f $stamp)
} else {
$tmpBase = if ($env:TEMP) { $env:TEMP } else { [System.IO.Path]::GetTempPath() }
$OutDir = Join-Path $tmpBase ("reverse-skill-route\master-route-{0}" -f $stamp)
skills/scripts/verify-routing-coherence.ps1:40
- This uses a Windows-style segment (
tests\routing-benchmark.json) in Join-Path. On Linux/macOS PowerShell this becomes a literal backslash in the filename, so the benchmark won’t be found.
skills/scripts/test-routing.ps1:33 $env:TEMPcan be unset on non-Windows runners. With$ErrorActionPreference='Stop', Join-Path will throw and the Ubuntu CI run can fail. Use the same GetTempPath fallback pattern as master-route.ps1.
if ([string]::IsNullOrWhiteSpace($LogDir)) {
$LogDir = Join-Path $env:TEMP ("rs-routing-test-{0}" -f (Get-Date -Format 'yyyyMMdd-HHmmss'))
}
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
skills/scripts/test-routing.ps1:48
- Per-case temp dir creation also assumes
$env:TEMPis set. On Linux/macOS this may throw; use[System.IO.Path]::GetTempPath()fallback to keep regression runs portable.
foreach ($c in $cases) {
$tmp = Join-Path $env:TEMP ("rs-rt-{0}" -f [guid]::NewGuid().ToString('n'))
$got = 'ERR'
skills/scripts/extract-summaries.ps1:28
- Directory extraction uses
$rel.Split('\\'), which won’t split Linux/macOS paths (they contain/). This can make the generated module name/path incorrect.
foreach ($sf in $skillFiles) {
$rel = $sf.FullName.Substring($skillsRoot.Length + 1)
$dir = $rel.Split('\')[0]
$head = Get-Content -LiteralPath $sf.FullName -TotalCount 15 -Encoding UTF8
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Supported scenarios| Scenario | Entry | | ||
| |----------|-------| |
| if (-not $scriptDir) { $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path } | ||
| $skillsRoot = Split-Path -Parent $scriptDir | ||
| $packageRoot = Split-Path -Parent $skillsRoot | ||
| $configPath = Join-Path $skillsRoot 'config\routing.json' |
| function Bad($m) { Write-Host "[FAIL] $m" -ForegroundColor Red; [void]$fail.Add($m) } | ||
|
|
||
| # --- 新事实源/产物检查(routing.json / benchmark / INDEX) --- | ||
| $routingJson = Join-Path $skillsRoot 'config\routing.json' |
| # --- supply-chain pin gate: auto-install download sources MUST be pinned --- | ||
| # 统一判定:pinnedVersion / pinnedCommit / pinPolicy 三选一; | ||
| # github-release-* 额外接受 assetSha256 / preferApiDigest(GitHub 官方发布资产哈希)。 | ||
| $pinKinds = @('pip-package', 'npm-mcp', 'npm-global', 'go-install', 'git-clone') |
| if (-not $PackageRoot) { $PackageRoot = Split-Path -Parent $skillsRoot } | ||
|
|
||
| if ([string]::IsNullOrWhiteSpace($Benchmark)) { | ||
| $Benchmark = Join-Path $skillsRoot 'tests\routing-benchmark.json' |
| $skillFiles = Get-ChildItem -Path $skillsRoot -Recurse -Filter 'SKILL.md' | Where-Object { | ||
| $rel = $_.FullName.Substring($skillsRoot.Length + 1) | ||
| $rel -ne 'SKILL.md' -and -not ($skipDirs | Where-Object { $rel.StartsWith($_ + '\') }) | ||
| } | Sort-Object FullName |
Address GitHub Copilot review comments on PR zhaoxuya520#43: - master-route.ps1: Join-Path per segment for OutDir (no literal backslashes) - verify-routing-coherence.ps1: forward-slash segments in Join-Path (16 paths) - test-routing.ps1: GetTempPath fallback for LogDir and per-case temp dirs - smoke.ps1 / case-init.ps1: GetTempPath fallback for TEMP usage - extract-summaries.ps1: split on both path separators; skip-dir match on both - install-opencode.ps1: opencode CLI absence is WARN not FAIL (CI-friendly)
…ning - verify-routing-coherence.ps1: GetTempPath fallback for ScratchDir (was the actual Ubuntu CI failure: Join-Path \C:\Users\asus\AppData\Local\Temp with null Path) - bootstrap-reverse.ps1: define tmpBase once, use for download/extract dirs - test-p0-friction.ps1: GetTempPath fallback for ScratchDir
# Conflicts: # kali/scripts/bootstrap-manifest.json
|
Hi @zhaoxuya520 👋 Just a heads-up on the current state of this PR and the fork: Update: fork
|
v1.1.0: 路由单一事实源 + 回归基准 + 供应链 pin + opencode 生态适配
向 reverse-skill 推荐一套实质性改进(2 commits,基于当前 main,零冲突)。核心思路:保持现有架构不变,把路由规则的维护方式升级为"单一数据源 + 回归测试"。
改进内容
1. 路由引擎:硬编码 → 单一事实源
skills/config/routing.json:R0–R39 全部关键词规则结构化(must/mustAll/exclude语义 + 边界注释)master-route.ps1改为读取 JSON(CLI 完全兼容:参数、输出、退出码不变),内置 priority 自检防漏.so/native/JNI、go 二进制(中文)、js 加密、webshell、提权、S3、应急响应、蓝牙 BLE、USB、Unity 等 20+ 盲区2. 回归测试体系(防止改路由改坏东西)
skills/tests/routing-benchmark.json:162 条中英双语用例(含jailbreak iphone→R2 vsLLM 越狱→R14 等边界)skills/scripts/test-routing.ps1:回归 runner.github/workflows/ci.yml:Windows + Ubuntu 双矩阵,push/PR 自动跑 5 项检查3. 供应链 pin gate(与现有安全理念闭环)
verify-routing-coherence.ps1新增强制检查:自动安装能力必须有pinnedVersion/pinnedCommit/pinPolicy/ 资产哈希,否则 FAIL4. 全局注入改为显式 opt-in(安全边界)
install-global.ps1(交互确认,写独立文件,不再向用户既有 CLAUDE.md/AGENTS.md 静默追加)+uninstall-global.ps1/.sh(零残留)RULES.md/RULES_zh.md同步更新:AI 未经确认禁止修改用户全局配置5. opencode 生态适配
opencode.jsonc:42 个 SKILL.md 通过skills.paths直接注册为 opencode skills + 5 个 MCP(默认关闭按需启用)AGENTS.md项目入口、.opencode/agent/reverse-router.md路由分诊子代理、install-opencode.ps1一键检查dsl-vm-reverse/SKILL.md缺失的 frontmatter(唯一没有 name/description 的模块)6. 其他
skills/INDEX.md自动导航索引(extract-summaries.ps1生成,-Check防 drift,行尾免疫)examples/ctf-demo/完整流程示例.gitattributes声明 LF 但提交为 CRLF,fresh clone 永远 dirty)测试证据
本地 + fresh clone 全流程验证(PowerShell 5.1):
兼容性
master-route.ps1/case-init.ps1/append-evidence.ps1等既有 CLI 契约全部不变可以怎么审
git diff main...improve-v1.1.0 --stat看变更面(34+5 个文件)powershell -File skills/scripts/test-routing.ps1验证 162 用例