@hongmaple0820/scale-engine 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -1,14 +1,14 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.10.1-orange?style=flat-square" alt="version" />
2
+ <img src="https://img.shields.io/badge/version-0.11.2-orange?style=flat-square" alt="version" />
3
3
  <img src="https://img.shields.io/badge/platforms-11-blue?style=flat-square" alt="platforms" />
4
4
  <img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
5
5
  <img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
6
- <img src="https://img.shields.io/badge/detectors-9-red?style=flat-square" alt="detectors" />
7
- <img src="https://img.shields.io/badge/tests-461-passing-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.10.1-cb3837?style=flat-square&logo=npm" alt="npm" />
6
+ <img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
7
+ <img src="https://img.shields.io/badge/tests-499-passing-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.11.2-cb3837?style=flat-square&logo=npm" alt="npm" />
9
9
  </p>
10
10
 
11
- # SCALE Engine v0.10.1
11
+ # SCALE Engine v0.11.2
12
12
 
13
13
  SCALE Engine is an AI engineering workflow runtime for agentic coding tools. It turns prompt-level engineering rules into stateful workflow gates, persisted evidence, review records, and release checks.
14
14
 
@@ -28,19 +28,42 @@ Prompt instructions are advisory. Production engineering needs mechanisms:
28
28
 
29
29
  ## Current Release
30
30
 
31
- v0.10.1 hardens the phase-aligned delivery workflow:
31
+ v0.11.1 introduces four priority improvements:
32
+
33
+ ### Phase Commands FSM Blocking
34
+ - `canTransition` + `process.exit(1)` ensures FSM guard failures block execution, not continue
35
+ - define/plan/build/verify phases add clear blocking prompts
36
+
37
+ ### OWASP Top 10 Detector
38
+ - New `OWASPDetector` covers SQL injection, XSS, path traversal, SSRF, Auth Bypass, weak crypto, CORS misconfiguration, CSRF, file upload, sensitive data exposure
39
+ - 19 security detection patterns, auto-recognizes regex definitions to avoid false positives
40
+
41
+ ### Browser QA Capability
42
+ - `BrowserQACapability` wraps Playwright MCP tools
43
+ - Supports navigation, click, screenshot, console check, E2E test flows
44
+
45
+ ### L6 Evolution Self-Improve Loop
46
+ - `LessonExtractor` extracts reusable lessons from session Defect events
47
+ - `SelfImproveEngine` implements `Defect → Lesson → Rule → Hook` promotion pipeline
48
+ - New CLI commands: `scale evolution extract/improve/report/hooks`
49
+
50
+ ---
51
+
52
+ **Complete phase-aligned delivery workflow**:
32
53
 
33
54
  - `define -> plan -> build -> verify -> review -> ship`
34
- - FSM-backed artifacts for specs, plans, and tasks
35
- - persisted gate evidence and review records
36
- - deterministic review scanner blocks empty `catch`, `@ts-ignore`, focused tests, dangerous shell/Git commands, and security-sensitive changes without G7 evidence
37
- - built-in G7 security scanning records explainable file/line evidence, blocks CRITICAL by default, and can block HIGH findings in strict mode
38
- - optional strict TDD evidence gate with `--tdd-evidence` and `--tdd-strict`
55
+ - FSM-backed artifacts with blocking on guard failures
56
+ - Persisted gate evidence and review records
57
+ - Deterministic review scanner blocks empty `catch`, `@ts-ignore`, focused tests, dangerous shell/Git commands, and security-sensitive changes without G7 evidence
58
+ - OWASP Top 10 security detector extends coverage
59
+ - Built-in G7 security scanning records explainable file/line evidence, blocks CRITICAL by default, can block HIGH in strict mode
60
+ - Optional strict TDD evidence gate with `--tdd-evidence` and `--tdd-strict`
39
61
  - `ship --no-commit` delivery reports
40
- - review-gated release commits
41
- - 11 platform adapters and 12 professional agent profiles
42
- - Exa/search capability integration
43
- - 461 Vitest tests passing after scoped ship, TDD evidence, review scanner, and G7 security scan hardening
62
+ - Review-gated release commits
63
+ - 11 platform adapters, 12 professional agent profiles
64
+ - Browser QA Capability (Playwright MCP)
65
+ - Evolution self-improve loop
66
+ - 499 Vitest tests passing
44
67
 
45
68
  ## Installation
46
69
 
@@ -75,6 +98,29 @@ scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
75
98
 
76
99
  The TDD evidence JSON must include `red`, `green`, `refactor`, and `testFirst` set to `true`.
77
100
 
101
+ ## Evolution Self-Improve Loop
102
+
103
+ Extract lessons from session defects and promote to rules and hooks:
104
+
105
+ ```bash
106
+ # Extract Lessons from session
107
+ scale evolution extract <session-id>
108
+
109
+ # Run self-improve loop: Defect → Lesson → Rule → Hook
110
+ scale evolution improve <session-id>
111
+
112
+ # Show self-improve report
113
+ scale evolution report <session-id>
114
+
115
+ # View generated Hooks config
116
+ scale evolution hooks <session-id> --json
117
+ ```
118
+
119
+ Thresholds:
120
+ - Lesson → Rule: requires 3 verifications
121
+ - Rule → Active: requires 10 hits
122
+ - Rule → Hook: requires 20 hits
123
+
78
124
  ## Safety Model
79
125
 
80
126
  SCALE Engine uses multiple enforcement layers:
@@ -117,14 +163,19 @@ It also includes 12 professional agent profiles:
117
163
  ```text
118
164
  src/api/cli.ts CLI entrypoint
119
165
  src/cli/phaseCommands.ts DEFINE/PLAN/BUILD/VERIFY/REVIEW/SHIP
166
+ src/cli/evolutionCommands.ts L6 Evolution CLI commands
120
167
  src/workflow/gates/ Quality gates and persisted evidence
121
168
  src/workflow/ReviewAnalyzer.ts Deterministic review analysis
122
169
  src/workflow/ReviewStore.ts Review record persistence
123
170
  src/workflow/EvidenceStore.ts Gate evidence persistence
171
+ src/workflow/evolution/ LessonExtractor + SelfImproveEngine
172
+ src/workflow/qa/ BrowserQA + E2ETestRunner
124
173
  src/artifact/ Artifact store and FSM definitions
125
174
  src/guardrails/ Detector and gateway logic
175
+ src/guardrails/OWASPDetector.ts OWASP Top 10 security detection
176
+ src/capabilities/BrowserQACapability.ts Playwright MCP wrapper
126
177
  src/evolution/ Defect/Lesson/Rule/Hook evolution layer
127
- tests/ Vitest test suites
178
+ tests/ Vitest test suites (499 tests)
128
179
  ```
129
180
 
130
181
  ## Development
@@ -145,6 +196,16 @@ npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.
145
196
 
146
197
  ## Release Notes
147
198
 
199
+ ### v0.11.1
200
+
201
+ - Phase Commands FSM blocking: `canTransition` + `process.exit(1)` for guard failures
202
+ - OWASP Top 10 Detector: 19 security detection patterns
203
+ - Browser QA Capability: Playwright MCP wrapper for E2E testing
204
+ - L6 Evolution: `Defect → Lesson → Rule → Hook` self-improve loop
205
+ - Evolution CLI: `scale evolution extract/improve/report/hooks`
206
+ - ReviewAnalyzer regex fix: avoid false positives on pattern definitions
207
+ - 499 tests passing
208
+
148
209
  ### v0.10.1
149
210
 
150
211
  - Hardened `ship` so release commits stage only files covered by passing review records.
package/README.md CHANGED
@@ -1,168 +1,229 @@
1
- <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.10.1-orange?style=flat-square" alt="version" />
3
- <img src="https://img.shields.io/badge/platforms-11-blue?style=flat-square" alt="platforms" />
4
- <img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
5
- <img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
6
- <img src="https://img.shields.io/badge/detectors-9-red?style=flat-square" alt="detectors" />
7
- <img src="https://img.shields.io/badge/tests-461-passing-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.10.1-cb3837?style=flat-square&logo=npm" alt="npm" />
9
- </p>
10
-
11
- # SCALE Engine v0.10.1
12
-
13
- SCALE Engine 是一个面向 AI 编码 Agent 的工程化工作流运行时。它把提示词里的工程纪律,下沉为状态机、质量门禁、持久化证据、确定性 review 记录和发布检查。
14
-
15
- 源码仓库:https://github.com/hongmaple0820/scale-engine
16
- 国内镜像:https://gitee.com/hongmaple/scale-engine
17
- npm:https://www.npmjs.com/package/@hongmaple0820/scale-engine
18
- 语言:[中文](README.md) | [English](README.en.md)
19
-
20
- ## 为什么需要它
21
-
22
- 提示词是建议,工程交付需要机制:
23
-
24
- - Agent 可以声称测试通过,SCALE 会保存真实验证证据。
25
- - Agent 可以跳过 review,SCALE 会在缺少 review 记录时阻断 `ship`。
26
- - Agent 可以误提交无关文件,SCALE 只暂存已通过 review 覆盖的文件。
27
- - Agent 可以丢失阶段状态,SCALE 会把 artifact 和 FSM 状态保存在 `.scale`。
28
-
29
- ## 当前版本
30
-
31
- v0.10.1 聚焦阶段化交付链路加固:
32
-
33
- - `define -> plan -> build -> verify -> review -> ship`
34
- - Spec、Plan、Task artifact 接入 FSM
35
- - 验证门禁证据持久化
36
- - 代码 review 记录持久化
37
- - 确定性 review scanner 会阻断空 `catch`、`@ts-ignore`、focused test、危险 shell/git 命令和缺 G7 证据的安全敏感变更
38
- - G7 内置安全扫描会记录可解释的文件/行号证据,默认阻断 CRITICAL,严格模式可阻断 HIGH
39
- - 可选严格 TDD evidence 门禁:`--tdd-evidence` 和 `--tdd-strict`
40
- - `ship --no-commit` 交付报告
41
- - `ship` 发布前强制验证 review evidence
42
- - 11 个平台适配器,12 个专业 Agent Profile
43
- - Exa/search capability 集成
44
- - 本轮 scoped ship、TDD evidence、review scanner 与 G7 security scan 加固后,461 个 Vitest 测试通过
45
-
46
- ## 安装
47
-
48
- ```bash
49
- npm install -g @hongmaple0820/scale-engine
50
- scale --version
51
- ```
52
-
53
- 需要 Node.js 20 或更高版本。
54
-
55
- ## 阶段工作流
56
-
57
- ```bash
58
- scale define "Scoped release workflow" \
59
- --description "Implement a TypeScript CLI workflow with verification evidence, review records, rollback constraints, and release safety checks." \
60
- --success-criteria "verify evidence is persisted,review evidence is persisted,ship blocks unreviewed files"
61
-
62
- scale plan <spec-id> --rollback "Revert the release commit and remove generated artifacts"
63
- scale build <plan-id> --description "Implement scoped release workflow"
64
- scale verify <task-id>
65
- scale review <task-id>
66
- scale ship <task-id> --message "feat(workflow): add scoped release workflow"
67
- ```
68
-
69
- 如果只需要生成交付报告,不创建 Git commit:
70
-
71
- ```bash
72
- scale ship <task-id> --no-commit
73
- ```
74
-
75
- 需要严格校验 TDD 证据时:
76
-
77
- ```bash
78
- scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
79
- ```
80
-
81
- TDD evidence JSON 需要包含 `red`、`green`、`refactor`、`testFirst` 且值都为 `true`。
82
-
83
- ## 安全模型
84
-
85
- | 层级 | 作用 |
86
- | --- | --- |
87
- | FSM | 阻止非法 artifact 状态流转 |
88
- | GateSystem | 执行 build、lint、test、coverage、security 门禁 |
89
- | EvidenceStore | 持久化验证证据,用于审计和发布门禁 |
90
- | ReviewStore | 持久化确定性 review 记录 |
91
- | ReviewAnalyzer | 扫描 diff 中的高风险代码、流程债和缺失安全证据 |
92
- | Detectors | 检测暴力重试、过早完成、甩锅、忙碌假象等失败模式 |
93
- | Ship gate | 发布前必须验证通过,并且 review evidence 必须存在且通过 |
94
-
95
- `ship` 不再执行 `git add .`。它只会暂存已通过 review 记录覆盖的文件;如果 review 后出现新的可 review 变更,`ship` 会阻断并要求重新 review。
96
-
97
- G7 `SecurityGate` 内置轻量安全扫描,覆盖硬编码密钥、私钥、TLS 校验关闭、`eval`/`Function`、原始 HTML 注入、危险 shell 命令、shell 执行和空 `catch` 等模式。兼容模式只阻断 CRITICAL;严格模式会同时阻断 HIGH。
98
-
99
- ## 支持的平台与角色
100
-
101
- SCALE Engine 内置 11 个平台适配器,包括 Claude Code、Codex CLI、OpenCode、Cursor、Gemini CLI、OpenClaw、Hermes、Trae、WorkBuddy、VS Code Copilot CLI、QCoder。
102
-
103
- 内置 12 个专业 Agent Profile:
104
-
105
- - frontend
106
- - backend
107
- - testing
108
- - UI design
109
- - operations
110
- - product
111
- - code review
112
- - security
113
- - database
114
- - performance
115
- - documentation
116
- - architecture
117
-
118
- ## 项目结构
119
-
120
- ```text
121
- src/api/cli.ts CLI 入口
122
- src/cli/phaseCommands.ts DEFINE/PLAN/BUILD/VERIFY/REVIEW/SHIP
123
- src/workflow/gates/ 质量门禁与验证证据
124
- src/workflow/ReviewAnalyzer.ts 确定性 review 分析
125
- src/workflow/ReviewStore.ts review 记录持久化
126
- src/workflow/EvidenceStore.ts gate evidence 持久化
127
- src/artifact/ artifact 存储与 FSM 定义
128
- src/guardrails/ detector 与 gateway
129
- src/evolution/ Defect/Lesson/Rule/Hook 自进化层
130
- tests/ Vitest 测试
131
- ```
132
-
133
- ## 开发与验证
134
-
135
- ```bash
136
- npm install
137
- npm run build
138
- npx vitest run
139
- npm pack --dry-run
140
- ```
141
-
142
- 工作流相关定向测试:
143
-
144
- ```bash
145
- npx vitest run tests/workflow/phaseCli.test.ts
146
- npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.test.ts tests/workflow/gateSystem.test.ts
147
- ```
148
-
149
- ## v0.10.1 更新
150
-
151
- - 新增 `ship --no-commit`。
152
- - 强化 `ship`:发布提交只暂存已 review 文件。
153
- - 新增可选严格 TDD evidence 校验。
154
- - 增强命令证据元数据:工作目录、时间戳、stdout/stderr 尾部和输出 hash。
155
- - 强化 deterministic review scanner:阻断空 `catch`、`@ts-ignore`、focused test、危险 shell/git 命令与缺 G7 证据的安全敏感变更。
156
- - 强化 G7 内置安全扫描:输出文件/行号证据,默认阻断 CRITICAL,严格模式阻断 HIGH。
157
- - 新增 `review -> ship`、未 review 文件阻断和安全扫描误报边界的 CLI/单元回归测试。
158
- - 发版前已验证 `npm run build`、完整 Vitest 测试和 `npm pack --dry-run`。
159
-
160
- ## v0.10.0 更新
161
-
162
- - 新增阶段化 CLI 工作流,并接入 FSM。
163
- - 新增验证证据和 review 记录持久化。
164
- - 发布 `@hongmaple0820/scale-engine@0.10.0`。
165
-
166
- ## License
167
-
168
- MIT
1
+ <p align="center">
2
+ <img src="https://img.shields.io/badge/version-0.12.0-orange?style=flat-square" alt="version" />
3
+ <img src="https://img.shields.io/badge/platforms-13-blue?style=flat-square" alt="platforms" />
4
+ <img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
5
+ <img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
6
+ <img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
7
+ <img src="https://img.shields.io/badge/tests-562-passing-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.12.0-cb3837?style=flat-square&logo=npm" alt="npm" />
9
+ </p>
10
+
11
+ # SCALE Engine v0.12.0
12
+
13
+ SCALE Engine 是一个面向 AI 编码 Agent 的工程化工作流运行时。它把提示词里的工程纪律,下沉为状态机、质量门禁、持久化证据、确定性 review 记录和发布检查。
14
+
15
+ 源码仓库:https://github.com/hongmaple0820/scale-engine
16
+ 国内镜像:https://gitee.com/hongmaple/scale-engine
17
+ npm:https://www.npmjs.com/package/@hongmaple0820/scale-engine
18
+ 语言:[中文](README.md) | [English](README.en.md)
19
+
20
+ ## 为什么需要它
21
+
22
+ 提示词是建议,工程交付需要机制:
23
+
24
+ - Agent 可以声称测试通过,SCALE 会保存真实验证证据。
25
+ - Agent 可以跳过 review,SCALE 会在缺少 review 记录时阻断 `ship`。
26
+ - Agent 可以误提交无关文件,SCALE 只暂存已通过 review 覆盖的文件。
27
+ - Agent 可以丢失阶段状态,SCALE 会把 artifact 和 FSM 状态保存在 `.scale`。
28
+
29
+ ## 当前版本
30
+
31
+ v0.11.1 新增四大优先级改进:
32
+
33
+ ### Phase Commands FSM 阻断
34
+ - `canTransition` + `process.exit(1)` 确保 FSM guard 失败时阻塞流程,而非继续执行
35
+ - define/plan/build/verify 各阶段添加明确的阻断提示
36
+
37
+ ### OWASP Top 10 检测器
38
+ - 新增 `OWASPDetector` 覆盖 SQL 注入、XSS、路径遍历、SSRF、Auth Bypass、弱加密、CORS 错误配置、CSRF、文件上传、敏感数据泄露
39
+ - 19 类安全检测模式,自动识别 regex 定义避免误报
40
+
41
+ ### Browser QA Capability
42
+ - `BrowserQACapability` 封装 Playwright MCP 工具
43
+ - 支持导航、点击、截图、console 检查、E2E 测试流程
44
+
45
+ ### L6 Evolution 自改进闭环
46
+ - `LessonExtractor` 从会话 Defect 事件提取可复用教训
47
+ - `SelfImproveEngine` 实现 `Defect → Lesson → Rule → Hook` 晋升流水线
48
+ - 新增 CLI 命令:`scale evolution extract/improve/report/hooks`
49
+
50
+ ---
51
+
52
+ **完整阶段化交付链路**:
53
+
54
+ - `define -> plan -> build -> verify -> review -> ship`
55
+ - Spec、Plan、Task artifact 接入 FSM,guard 失败时阻断而非继续
56
+ - 验证门禁证据持久化
57
+ - 代码 review 记录持久化
58
+ - 确定性 review scanner 会阻断空 `catch`、`@ts-ignore`、focused test、危险 shell/git 命令和缺 G7 证据的安全敏感变更
59
+ - OWASP Top 10 安全检测器扩展安全覆盖
60
+ - G7 内置安全扫描会记录可解释的文件/行号证据,默认阻断 CRITICAL,严格模式可阻断 HIGH
61
+ - 可选严格 TDD evidence 门禁:`--tdd-evidence` 和 `--tdd-strict`
62
+ - `ship --no-commit` 交付报告
63
+ - `ship` 发布前强制验证 review evidence
64
+ - 11 个平台适配器,12 个专业 Agent Profile
65
+ - Browser QA Capability (Playwright MCP)
66
+ - Evolution 自改进闭环
67
+ - 本轮加固后,499 个 Vitest 测试通过
68
+
69
+ ## 安装
70
+
71
+ ```bash
72
+ npm install -g @hongmaple0820/scale-engine
73
+ scale --version
74
+ ```
75
+
76
+ 需要 Node.js 20 或更高版本。
77
+
78
+ ## 阶段工作流
79
+
80
+ ```bash
81
+ scale define "Scoped release workflow" \
82
+ --description "Implement a TypeScript CLI workflow with verification evidence, review records, rollback constraints, and release safety checks." \
83
+ --success-criteria "verify evidence is persisted,review evidence is persisted,ship blocks unreviewed files"
84
+
85
+ scale plan <spec-id> --rollback "Revert the release commit and remove generated artifacts"
86
+ scale build <plan-id> --description "Implement scoped release workflow"
87
+ scale verify <task-id>
88
+ scale review <task-id>
89
+ scale ship <task-id> --message "feat(workflow): add scoped release workflow"
90
+ ```
91
+
92
+ 如果只需要生成交付报告,不创建 Git commit:
93
+
94
+ ```bash
95
+ scale ship <task-id> --no-commit
96
+ ```
97
+
98
+ 需要严格校验 TDD 证据时:
99
+
100
+ ```bash
101
+ scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
102
+ ```
103
+
104
+ TDD evidence JSON 需要包含 `red`、`green`、`refactor`、`testFirst` 且值都为 `true`。
105
+
106
+ ## Evolution 自改进闭环
107
+
108
+ 从会话缺陷中提取教训,晋升为规则和 Hook:
109
+
110
+ ```bash
111
+ # 从会话提取 Lessons
112
+ scale evolution extract <session-id>
113
+
114
+ # 运行自改进闭环:Defect → Lesson → Rule → Hook
115
+ scale evolution improve <session-id>
116
+
117
+ # 显示自改进报告
118
+ scale evolution report <session-id>
119
+
120
+ # 查看生成的 Hooks 配置
121
+ scale evolution hooks <session-id> --json
122
+ ```
123
+
124
+ 阈值配置:
125
+ - Lesson → Rule:需验证 3 次
126
+ - Rule → Active:需触发 10 次
127
+ - Rule Hook:需触发 20 次
128
+
129
+ ## 安全模型
130
+
131
+ | 层级 | 作用 |
132
+ | --- | --- |
133
+ | FSM | 阻止非法 artifact 状态流转 |
134
+ | GateSystem | 执行 build、lint、test、coverage、security 门禁 |
135
+ | EvidenceStore | 持久化验证证据,用于审计和发布门禁 |
136
+ | ReviewStore | 持久化确定性 review 记录 |
137
+ | ReviewAnalyzer | 扫描 diff 中的高风险代码、流程债和缺失安全证据 |
138
+ | Detectors | 检测暴力重试、过早完成、甩锅、忙碌假象等失败模式 |
139
+ | Ship gate | 发布前必须验证通过,并且 review evidence 必须存在且通过 |
140
+
141
+ `ship` 不再执行 `git add .`。它只会暂存已通过 review 记录覆盖的文件;如果 review 后出现新的可 review 变更,`ship` 会阻断并要求重新 review。
142
+
143
+ G7 `SecurityGate` 内置轻量安全扫描,覆盖硬编码密钥、私钥、TLS 校验关闭、`eval`/`Function`、原始 HTML 注入、危险 shell 命令、shell 执行和空 `catch` 等模式。兼容模式只阻断 CRITICAL;严格模式会同时阻断 HIGH。
144
+
145
+ ## 支持的平台与角色
146
+
147
+ SCALE Engine 内置 11 个平台适配器,包括 Claude Code、Codex CLI、OpenCode、Cursor、Gemini CLI、OpenClaw、Hermes、Trae、WorkBuddy、VS Code Copilot CLI、QCoder。
148
+
149
+ 内置 12 个专业 Agent Profile:
150
+
151
+ - frontend
152
+ - backend
153
+ - testing
154
+ - UI design
155
+ - operations
156
+ - product
157
+ - code review
158
+ - security
159
+ - database
160
+ - performance
161
+ - documentation
162
+ - architecture
163
+
164
+ ## 项目结构
165
+
166
+ ```text
167
+ src/api/cli.ts CLI 入口
168
+ src/cli/phaseCommands.ts DEFINE/PLAN/BUILD/VERIFY/REVIEW/SHIP
169
+ src/cli/evolutionCommands.ts L6 Evolution CLI 命令
170
+ src/workflow/gates/ 质量门禁与验证证据
171
+ src/workflow/ReviewAnalyzer.ts 确定性 review 分析
172
+ src/workflow/ReviewStore.ts review 记录持久化
173
+ src/workflow/EvidenceStore.ts gate evidence 持久化
174
+ src/workflow/evolution/ LessonExtractor + SelfImproveEngine
175
+ src/workflow/qa/ BrowserQA + E2ETestRunner
176
+ src/artifact/ artifact 存储与 FSM 定义
177
+ src/guardrails/ detector 与 gateway
178
+ src/guardrails/OWASPDetector.ts OWASP Top 10 安全检测
179
+ src/capabilities/BrowserQACapability.ts Playwright MCP 包装器
180
+ src/evolution/ Defect/Lesson/Rule/Hook 自进化层
181
+ tests/ Vitest 测试 (499 tests)
182
+ ```
183
+
184
+ ## 开发与验证
185
+
186
+ ```bash
187
+ npm install
188
+ npm run build
189
+ npx vitest run
190
+ npm pack --dry-run
191
+ ```
192
+
193
+ 工作流相关定向测试:
194
+
195
+ ```bash
196
+ npx vitest run tests/workflow/phaseCli.test.ts
197
+ npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.test.ts tests/workflow/gateSystem.test.ts
198
+ ```
199
+
200
+ ## v0.11.1 更新
201
+
202
+ - Phase Commands FSM 阻断:`canTransition` + `process.exit(1)` 确保 guard 失败时阻塞
203
+ - OWASP Top 10 检测器:19 类安全检测模式
204
+ - Browser QA Capability:Playwright MCP 包装器用于 E2E 测试
205
+ - L6 Evolution:`Defect → Lesson → Rule → Hook` 自改进闭环
206
+ - Evolution CLI:`scale evolution extract/improve/report/hooks`
207
+ - ReviewAnalyzer regex 修复:避免模式定义误报
208
+ - 499 测试通过
209
+
210
+ ## v0.10.1 更新
211
+
212
+ - 新增 `ship --no-commit`。
213
+ - 强化 `ship`:发布提交只暂存已 review 文件。
214
+ - 新增可选严格 TDD evidence 校验。
215
+ - 增强命令证据元数据:工作目录、时间戳、stdout/stderr 尾部和输出 hash。
216
+ - 强化 deterministic review scanner:阻断空 `catch`、`@ts-ignore`、focused test、危险 shell/git 命令与缺 G7 证据的安全敏感变更。
217
+ - 强化 G7 内置安全扫描:输出文件/行号证据,默认阻断 CRITICAL,严格模式阻断 HIGH。
218
+ - 新增 `review -> ship`、未 review 文件阻断和安全扫描误报边界的 CLI/单元回归测试。
219
+ - 发版前已验证 `npm run build`、完整 Vitest 测试和 `npm pack --dry-run`。
220
+
221
+ ## v0.10.0 更新
222
+
223
+ - 新增阶段化 CLI 工作流,并接入 FSM。
224
+ - 新增验证证据和 review 记录持久化。
225
+ - 发布 `@hongmaple0820/scale-engine@0.10.0`。
226
+
227
+ ## License
228
+
229
+ MIT
@@ -0,0 +1,19 @@
1
+ import type { IAgentAdapter, AdapterConfig, InitResult, SettingsJson } from './ClaudeCodeAdapter.js';
2
+ export declare class DeepSeekTuiAdapter implements IAgentAdapter {
3
+ readonly agentType = "deepseek-tui";
4
+ private projectDir;
5
+ private scaleDir;
6
+ getSettingsPath(): string;
7
+ getKnowledgeDocPath(): string;
8
+ getSkillsDir(): string;
9
+ isInstalled(): boolean;
10
+ generateSettings(): SettingsJson;
11
+ /**
12
+ * 生成 .deepseek/config.toml 项目覆盖配置
13
+ * 仅包含 #485 项目 overlay 支持的顶层字段
14
+ */
15
+ generateConfigToml(scenarioMode?: 'sandbox' | 'standard' | 'critical'): string;
16
+ mergeSettings(existing: SettingsJson): SettingsJson;
17
+ generateKnowledgeDoc(projectName: string, techStack?: string[]): string;
18
+ init(config: AdapterConfig): Promise<InitResult>;
19
+ }