Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ba6efdd
chore: establish 0.2.0 TypeScript test foundation
Nov 3, 2026
6bf5754
feat: add task and report domain contracts
Nov 3, 2026
0d00ec9
feat: add versioned config store and migration
Nov 3, 2026
4533fca
feat: add deterministic git and selection pipeline
Nov 3, 2026
b17b9b1
feat: add isolated PTC runner and readonly SDK
Nov 3, 2026
9450780
feat: add LLM transport and usage normalization
Nov 3, 2026
eb2cd31
feat: add stable prompt assembly with cache-friendly prefix
Nov 3, 2026
fb67d6d
feat: add single-agent loop with bounded stop conditions
Nov 3, 2026
7ae9f91
feat: add hierarchical multi-agent review orchestration
Nov 3, 2026
8943b35
feat: add finding convergence and dual report output
Nov 3, 2026
7f46895
chore: add end-to-end review demo
Nov 3, 2026
1a03261
feat: add task store, single-instance lock and kernel lifecycle
Nov 3, 2026
32e0905
feat: replace plugin shell with kernel-dispatching tools
Nov 3, 2026
f30b784
feat: add settings schema and panel structure
Nov 3, 2026
6ccc1b3
test: add controlled token benchmark for PTC vs native
Nov 3, 2026
b3b6843
test: add end-to-end pipeline test from submit to report
Nov 3, 2026
19b6e96
chore: retire Go engine and prepare 0.2.0 release
Nov 3, 2026
a7bdcea
feat: add task cancellation with distinct request/cancelled states
Nov 3, 2026
800c347
ci: replace Go-era workflows with Node verification pipeline
Nov 3, 2026
b5ea769
feat: add programmatic config tool for editor-free setup
Nov 3, 2026
0fd828c
test: verify plugin mounts and its tools are callable
Nov 3, 2026
a6fd269
test: cover full-repository scan path end to end
Nov 3, 2026
227d197
chore: add release verification and upgrade guide
Nov 3, 2026
50db029
feat: add browser settings panel via slots
Nov 3, 2026
2055475
chore: sync lockfile and tsconfig jsx option
Nov 3, 2026
f58aab1
docs: document settings panel and update upgrade guide
Nov 3, 2026
5c913d2
chore: add release archive packaging
Nov 3, 2026
b0b9bcc
fix: use relative archive path for Windows tar
Nov 3, 2026
f0da4d4
chore: ignore release artifacts directory
Nov 3, 2026
cd59b9f
docs: require user review before any public operation
Nov 3, 2026
d75570e
fix: close three gaps found by self-review
Nov 3, 2026
342bdd5
fix: locate findings where the diff is actually available
Nov 3, 2026
5bda030
fix: wire finding deduplication and preserve discovery sources
Nov 4, 2026
8d57b74
fix: redact only free text so structured identifiers stay readable
Nov 4, 2026
a1a3a61
chore: drop obsolete std-facet manifest and package upgrade notes
Nov 4, 2026
4f58be8
fix: launch child processes in Electron Node mode
Nov 4, 2026
fba2f98
fix: build client bundle for DSH module loader instead of ESM
Nov 4, 2026
cf6ea8c
test: clean up runner test temp directories
Nov 4, 2026
420e8ab
fix: surface client diagnostics and drop unnecessary package deps
Nov 4, 2026
1c32a85
fix(settings): mount row config through slots.inject and export Config
Nicholas023 Nov 4, 2026
7ff8090
feat(credentials): resolve DSH credentials in the host and hand them …
Nicholas023 Nov 4, 2026
231c80b
fix(llm): omit max_tokens when the output budget is unlimited
Nicholas023 Nov 4, 2026
88a9c98
fix(scan): synthesize whole files so sizing and prompts carry real vo…
Nicholas023 Nov 4, 2026
b7be87d
fix: stop faking a clean review and stop wasting children on small tiers
Nicholas023 Nov 4, 2026
0e5c30c
fix(llm): pin temperature to 0 and salvage findings when rounds run out
Nicholas023 Nov 4, 2026
1ff5de3
fix: keep findings with unknown enums and fail loudly on truncated ou…
Nicholas023 Nov 4, 2026
c3b1d55
fix(llm): read cache-hit tokens from every convention providers use
Nicholas023 Nov 4, 2026
73f2c31
feat(budget): make the cost ceiling real and opt-in by price
Nicholas023 Nov 4, 2026
2e7e588
feat(budget): make the cost limit real, and let decimals be typed
Nicholas023 Nov 4, 2026
e155410
fix(budget): say so when a run overshoots the cost ceiling
Nicholas023 Nov 4, 2026
5021698
fix(cost): scale money precision to the amount
Nicholas023 Nov 4, 2026
3e4f662
fix(test): use platform-absolute paths in submit tests
Nicholas023 Nov 4, 2026
cc0a6b5
fix(test): platform-absolute repo path in apply tests
Nicholas023 Nov 4, 2026
f563f23
refactor(config): drop the 0.1.x migration path and say so plainly
Nicholas023 Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 16 additions & 9 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# GitHub Actions 工作流(规划中)
# GitHub Actions 工作流

骨架阶段不放置空 workflow 文件(避免 GitHub 拉取后直接报失败告警)。
代码落地后按以下规划在此逐项落文件:
0.2.0 起只有两个工作流,都在 `ci.yml` 里:

| 文件 | 计划内容 |
| Job | 内容 |
|---|---|
| `lint.yml` | src(eslint/prettier)+ engine(golangci-lint) |
| `test.yml` | 单元测试(插件 + 引擎) |
| `build.yml` | 编译验证:`node` 构建 + `go build`(Windows 单文件二进制) |
| `secret-scan.yml` | 零敏感自检:扫描仓库自身是否存在硬编码密钥 / 凭据 / 内部服务地址痕迹 |
| `verify`(ubuntu + windows) | 类型检查 → 测试(331 个,含端到端与安全回归)→ 构建 → 入口可加载断言 → token 基准(估算模式) |
| `secret-scan` | 确保没有被跟踪的凭据文件(`.env`、私钥、`.pem` 等) |

> 红线提醒:工作流文件同样遵守零敏感原则,不得写入任何平台 key / 。
## 红线

- 任何需要**真实凭据或联网**的验证都不进 CI。
- 需要真实端点的对比实验走 `scripts/benchmark-tokens.mjs --real`,由人工在本地执行。
- 工作流文件本身也遵守零敏感原则:不写入任何平台的 key、端点或内部地址。

## 为什么没有 lint 工作流

0.1.x 的 lint 依赖引擎侧的 golangci-lint;引擎已随 0.2.0 退役。
TypeScript 侧目前以 `tsc --noEmit`(strict 全开)作为主要静态门禁,
引入额外 lint 规则前先确认它真的能拦住一类问题,而不是制造格式噪声。
122 changes: 31 additions & 91 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: CI

# 发布前门禁:语法检查(JS + Go)、冒烟矩阵、敏感扫描三组。
# 红线:四个 e2e(e2e-engine / e2e-plugin / e2e-switch / e2e-sensitive)需要真实
# 凭据与联网,会触碰付费通道,**严禁**纳入 CI。
# 0.2.0 门禁:类型检查 → 测试(跨平台)→ 构建 → 基准(估算模式)。
#
# 红线:任何需要真实凭据或联网的工作**不进 CI**。
# 需要真实端点的验证走 scripts/benchmark-tokens.mjs --real(人工执行)。
on:
push:
branches: [main]
Expand All @@ -12,9 +13,8 @@ permissions:
contents: read

jobs:
# ① 语法与静态检查:JS node --check + 引擎侧 gofmt / go vet。
check:
name: check (${{ matrix.os }})
verify:
name: verify (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -25,101 +25,41 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
cache: npm

- run: npm ci
- name: JS 语法检查(npm run check)
run: npm run check

- uses: actions/setup-go@v5
with:
go-version: '1.26.9'
- name: gofmt 检查(必须无输出)
working-directory: engine
- name: 类型检查
run: npm run typecheck

- name: 测试(含端到端与安全回归)
run: npm run test

- name: 构建
run: npm run build

- name: 产物入口可加载
shell: bash
run: |
out=$(gofmt -l .)
if [ -n "$out" ]; then
echo "以下文件未通过 gofmt:"
echo "$out"
exit 1
fi
- name: go vet
working-directory: engine
run: go vet ./...
- name: go test -short
working-directory: engine
shell: bash
run: go test -short ./...
- name: go build
working-directory: engine
run: go build ./...

# ② 冒烟矩阵(隔离环境,不联网、不触付费通道)。
smoke:
name: smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
node --input-type=module -e "import('./dist/plugin/index.js').then(m => { if (m.name !== 'dsh-code-review') process.exit(1); console.log('entry ok'); })"

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- name: unit-smoke
run: node scripts/unit-smoke.mjs
- name: file-config-smoke
run: node scripts/file-config-smoke.mjs
- name: task-api-smoke
run: node scripts/task-api-smoke.mjs
- name: cordis-entry-smoke
run: node scripts/cordis-entry-smoke.mjs
- name: client-bundle-smoke
run: node scripts/client-bundle-smoke.mjs
- name: serve-smoke
run: node scripts/serve-smoke.mjs
- name: token 基准(仅估算,不联网)
run: node scripts/benchmark-tokens.mjs

# ③ 敏感扫描三组:任一命中数 > 0 即失败(内容级权威判据)。
sensitive:
name: sensitive (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
# 单独一刀:确保仓库里没有被误提交的凭据/私钥。
secret-scan:
name: secret scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 敏感扫描三组
- name: 检查敏感文件是否被跟踪
shell: bash
run: |
# 模式串用「字符类断字」(如 C[U]CC)书写:避免本工作流文件自身文本
# 被自己的正则命中(否则 ci.yml 里那几个平台/账号类字面量会恒报 1 命中)。
# 语义与任务书三组模式完全一致。
fail=0
scan() {
name="$1"
pat="$2"
# GitHub Actions 的 bash 带 `-e -o pipefail`:git grep 0 命中时退出码 1,
# 会让整条管道失败并触发 set -e。`|| true` 只吞掉「无命中」的退出码,
# 命中计数仍来自 wc -l(0 命中 → 计数 0)。
cnt=$(git grep -I -E "$pat" -- . ':!engine/**' | wc -l | tr -d ' ' || true)
echo "[$name] hits=$cnt"
if [ "$cnt" != "0" ]; then
fail=1
git grep -I -n -E "$pat" -- . ':!engine/**' || true
fi
}
scan sk 'sk-[A-Za-z0-9]{16,}'
scan platform '(C[U]CC|G[L]M|10\.186|dsh-llm[-])'
scan account 'llm-deepseek-accoun[t]'
if [ "$fail" != "0" ]; then
echo "敏感扫描命中,禁止合入。"
set -e
# 这些文件类型不应出现在版本控制里
if git ls-files | grep -Ei '(^|/)(\.env(\..*)?|id_(rsa|ed25519|ecdsa|dsa)|.*\.(pem|p12|pfx|key))$'; then
echo "::error::发现被跟踪的敏感文件"
exit 1
fi
echo "敏感扫描三组全部 0 命中。"
echo "未发现被跟踪的敏感文件"
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ credentials.txt
# ---------- Node / DSH 插件 ----------
node_modules/
dist/
# 发布产物(scripts/release.mjs 生成)
release/
# npm pack 产物
*.tgz
build/
*.log
npm-debug.log*
Expand Down Expand Up @@ -104,3 +108,6 @@ Desktop.ini
# 引擎二进制产物(构建可复现,从 GitHub Releases 分发,不入库)
bin/


# gh CLI 在仓库内留下的本地状态(不应提交)
.local/
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

本文件遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。

## [0.2.0] - 2026-11-04

**重写版本:自研 Node/TypeScript 审查内核替换 Go/OCR 引擎。**

### Changed(架构)

- **内核自研且进程外**:不再 spawn `codecheck.exe`,改为独立 Node 进程。DSH 会话关闭、插件重载都不影响正在跑的评审;任务卡是唯一共享状态。
- **PTC 执行模式**:模型不逐个调用工具,而是写一段程序在沙箱里执行,工具结果不进上下文。对比多轮工具调用,上下文开销显著下降(本地基准见 `npm run bench`)。
- **主/子 agent 分层**:主 agent 看全局找跨文件问题,子 agent 深挖超阈值单元;派发 = 确定性规则打底 + 主 agent 追加。
- **只读 SDK + 子进程沙箱**:内核只有 read/glob/grep;模型代码在独立子进程运行,硬超时 + 内存上限,路径围栏拒绝逃逸。
- **双报告**:Markdown(人读)+ JSON(机器读),原子写入,同一 run 共用 basename。
- **配置 v2**:分区结构(review/execution/budget/report/sizing),带版本号与迁移链;**写入保留未知字段**,修掉 0.1.x「未知键剔除」的丢配置缺陷。
- **设置描述层**:字段描述(`meta.volatile` + Standard Schema)与页面结构(路径寻址 + 门控)分离,供宿主渲染。

### Removed

- `engine/`(Go,477 文件)与 `bin/codecheck.exe` 整体退役;源码归档于 `archive/0.1.3-go-engine` 标签。
- 旧插件外壳 `src/*.js`(17 个文件)、`client.js`、`std-facet.js`。
- `engine_bin` 配置字段(0.2.0 无外部引擎);`concurrency` 语义改为「同时运行的评审任务数」。
- 运行时依赖 `@deepseek-ai/schemastery`、`js-yaml`。

### Known gaps(0.2.0 首发未覆盖)

- 设置面板目前只有**数据层**(字段描述 + 页面结构 + 门控),客户端 slots 组件尚未接入。
- 任务取消在领域层有状态字段,但没有工具入口暴露给用户。
- 真实端点的 token 基准需要人工配置 `BENCH_*` 环境变量后运行。

## [0.1.3] - 2026-10-21

### Fixed(issue #9–#24 汇集,含 4 路方案整合 #29)
Expand Down
28 changes: 24 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
```

- **type**(英文前缀):`feat` 新功能 / `fix` 修 bug / `docs` 文档 / `refactor` 重构 / `chore` 构建与杂务 / `test` 测试 / `build` 构建 / `perf` 性能。
- **scope** 示例:`plugin`(DSH 插件侧)/ `engine`(codecheck 引擎侧)/ `rule`(评审规则)。
- **scope** 示例:`plugin`(DSH 插件侧)/ `kernel`(审查内核)/ `rule`(评审规则)。0.2.0 起没有独立引擎进程。
- 摘要写「为什么」,不写「改了什么」(后者由 diff 承担);必要时正文展开动机。
- **一次提交 = 一个意图**:能用一个「因为…所以…」讲完才提交;讲不完就拆,禁止一次提交跨多个模块的混合变更。
- **提交前自检**:语法/编译检查通过(Go engine:`go build`;Node 插件:`node --check` / 类型检查);`git status` 逐个核对无敏感文件、无运行时产物混入;不用 `git add -A` 盲提交。
- **提交前自检**:`npm run typecheck && npm run test` 必须全绿;`git status` 逐个核对无敏感文件、无运行时产物混入(`dist/`、`release/` 已被忽略);不用 `git add -A` 盲提交。

## 3. PR 流程

Expand All @@ -48,14 +48,34 @@
1. **零敏感原则**:插件/引擎代码不硬编码任何特定平台、账号、密钥(详见 README「评审模型」与 SECURITY.md)。提交前 `git diff` 自查。
2. **敏感文件不进历史**:`.env`、密钥、凭据、PII、内部 IP/域名一律不提交;`.gitignore` 已含拦截模式,但 `git add` 前仍须逐文件核对(误提交后处理见全局 `version-control` skill:先轮换凭据,再清历史)。
3. **评审报告不入库**:`reports/` 已忽略(评审报告含被审代码内容,属运行时留档凭证)。
4. **引擎 fork 合规**:engine/ 自 open-code-review 拷贝时保留上游版权与 NOTICE 声明(Apache-2.0 §4)。
4. **来源与许可**:0.2.0 的实现与 alibaba/open-code-review 无关,但规则设计思路参考了它;`NOTICE` 保留这份归属说明,不要删除。

## 6. 开发流程

- **小步走**:一次提交一个意图(§2);未完成的阶段性工作留在 `feature/*` 分支,验证通过再合 `main`。
- **提交前自检**:`node --check` / `go build` 通过;`git status` 逐个核对无敏感文件、无运行时产物混入(§5)。
- **提交前自检**:`npm run typecheck && npm run test` 通过;`git status` 逐个核对无敏感文件、无运行时产物混入(§5)。
- **发布前必经关**:零敏感自检(见 SECURITY.md)通过 + 至少一次评审(异构优先);本地 DSH 环境热装验收通过。

## 7. 文档同步义务

- 改动使 README 自解释失效时,同步更新 README 与 CHANGELOG;提交信息写「为什么」(§2)。

## 公开操作必须经用户审核(红线)

以下动作会**改变外界能看到的东西**,执行前必须把内容交给用户审核、得到明确同意:

| 操作 | 说明 |
|---|---|
| `git push` | 推送任何分支到远端 |
| 创建 / 编辑 PR | 包括 PR 标题、正文、评论 |
| GitHub Release | 上传归档、写发布说明 |
| `npm publish` | 发布到任何 registry |
| 在 issue 下评论 | 视为对外发言 |
| 修改仓库设置 / 分支保护 / CI 密钥 | 影响协作面 |

**默认行为**:所有工作留在本地 worktree 的分支上,不推送、不建 PR、不发版。
需要公开时,先把「要公开什么」列清楚(分支名、提交清单、PR 正文草稿、
归档内容与哈希),等用户点头再执行。

**为什么单列这一条**:代码审查插件本身处理的就是「会不会把不该公开的东西发出去」,
它自己的发布流程如果不设这道闸,就是个笑话。
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ bin/codecheck(.exe))是 open-code-review 的 fork 改造:
上游完整许可文本见 engine/LICENSE;引擎内嵌图标的上游归属声明见
engine/internal/viewer/static/icons/NOTICE,均按原样保留。

本仓库自身代码(src/、scripts/、client.js、std-facet.js 等)同样以
本仓库自身代码(src/、scripts/、dist/ 等)同样以
Apache License 2.0 发布,完整文本见根目录 LICENSE。
Loading
Loading