@hongmaple0820/scale-engine 0.18.0 → 0.20.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.
Files changed (110) hide show
  1. package/README.en.md +310 -237
  2. package/README.md +255 -63
  3. package/dist/api/cli.js +2656 -1258
  4. package/dist/api/cli.js.map +1 -1
  5. package/dist/api/doctor.d.ts +4 -1
  6. package/dist/api/doctor.js +85 -1
  7. package/dist/api/doctor.js.map +1 -1
  8. package/dist/api/quickstart.d.ts +3 -0
  9. package/dist/api/quickstart.js +9 -4
  10. package/dist/api/quickstart.js.map +1 -1
  11. package/dist/cli/phaseCommands.js +7 -0
  12. package/dist/cli/phaseCommands.js.map +1 -1
  13. package/dist/codegraph/CodeIntelligence.d.ts +135 -0
  14. package/dist/codegraph/CodeIntelligence.js +460 -0
  15. package/dist/codegraph/CodeIntelligence.js.map +1 -0
  16. package/dist/context/ContextBudget.d.ts +90 -0
  17. package/dist/context/ContextBudget.js +322 -0
  18. package/dist/context/ContextBudget.js.map +1 -0
  19. package/dist/eval/WorkflowEval.d.ts +161 -0
  20. package/dist/eval/WorkflowEval.js +379 -0
  21. package/dist/eval/WorkflowEval.js.map +1 -0
  22. package/dist/governance/GovernanceRoi.d.ts +25 -0
  23. package/dist/governance/GovernanceRoi.js +70 -0
  24. package/dist/governance/GovernanceRoi.js.map +1 -0
  25. package/dist/governance/ProgressiveGovernance.d.ts +22 -0
  26. package/dist/governance/ProgressiveGovernance.js +159 -0
  27. package/dist/governance/ProgressiveGovernance.js.map +1 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +4 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/memory/MemoryBrain.d.ts +135 -0
  32. package/dist/memory/MemoryBrain.js +635 -0
  33. package/dist/memory/MemoryBrain.js.map +1 -0
  34. package/dist/memory/MemoryFabric.d.ts +118 -0
  35. package/dist/memory/MemoryFabric.js +281 -0
  36. package/dist/memory/MemoryFabric.js.map +1 -0
  37. package/dist/memory/MemoryLearning.d.ts +61 -0
  38. package/dist/memory/MemoryLearning.js +203 -0
  39. package/dist/memory/MemoryLearning.js.map +1 -0
  40. package/dist/memory/index.d.ts +3 -0
  41. package/dist/memory/index.js +4 -0
  42. package/dist/memory/index.js.map +1 -0
  43. package/dist/output/GovernanceDashboard.d.ts +57 -0
  44. package/dist/output/GovernanceDashboard.js +250 -0
  45. package/dist/output/GovernanceDashboard.js.map +1 -0
  46. package/dist/output/HTMLArtifactLayer.js +31 -31
  47. package/dist/output/index.d.ts +2 -0
  48. package/dist/output/index.js +1 -0
  49. package/dist/output/index.js.map +1 -1
  50. package/dist/prompts/VibeTemplateGallery.js +121 -121
  51. package/dist/runtime/FinalReportGuard.d.ts +16 -0
  52. package/dist/runtime/FinalReportGuard.js +14 -0
  53. package/dist/runtime/FinalReportGuard.js.map +1 -0
  54. package/dist/runtime/RuntimeDoctor.d.ts +23 -0
  55. package/dist/runtime/RuntimeDoctor.js +151 -0
  56. package/dist/runtime/RuntimeDoctor.js.map +1 -0
  57. package/dist/runtime/RuntimeEvidenceLedger.d.ts +50 -0
  58. package/dist/runtime/RuntimeEvidenceLedger.js +89 -0
  59. package/dist/runtime/RuntimeEvidenceLedger.js.map +1 -0
  60. package/dist/runtime/SessionLedger.d.ts +53 -0
  61. package/dist/runtime/SessionLedger.js +104 -0
  62. package/dist/runtime/SessionLedger.js.map +1 -0
  63. package/dist/runtime/index.d.ts +4 -0
  64. package/dist/runtime/index.js +5 -0
  65. package/dist/runtime/index.js.map +1 -0
  66. package/dist/skills/SkillRadar.d.ts +83 -0
  67. package/dist/skills/SkillRadar.js +384 -0
  68. package/dist/skills/SkillRadar.js.map +1 -0
  69. package/dist/workflow/EngineeringStandards.js +69 -66
  70. package/dist/workflow/EngineeringStandards.js.map +1 -1
  71. package/dist/workflow/GovernanceTemplatePacks.js +126 -126
  72. package/dist/workflow/GovernanceTemplates.d.ts +1 -1
  73. package/dist/workflow/GovernanceTemplates.js +500 -229
  74. package/dist/workflow/GovernanceTemplates.js.map +1 -1
  75. package/dist/workflow/ResourceGovernance.js +27 -18
  76. package/dist/workflow/ResourceGovernance.js.map +1 -1
  77. package/dist/workflow/VerificationCommands.d.ts +11 -0
  78. package/dist/workflow/VerificationCommands.js +2 -0
  79. package/dist/workflow/VerificationCommands.js.map +1 -1
  80. package/dist/workflow/VerificationProfile.d.ts +2 -1
  81. package/dist/workflow/VerificationProfile.js +3 -0
  82. package/dist/workflow/VerificationProfile.js.map +1 -1
  83. package/dist/workflow/WorkflowArtifactWriter.js +2 -1
  84. package/dist/workflow/WorkflowArtifactWriter.js.map +1 -1
  85. package/dist/workflow/WorkflowEngine.js +4 -1
  86. package/dist/workflow/WorkflowEngine.js.map +1 -1
  87. package/dist/workflow/WorkspaceSafety.d.ts +9 -0
  88. package/dist/workflow/WorkspaceSafety.js +49 -0
  89. package/dist/workflow/WorkspaceSafety.js.map +1 -0
  90. package/dist/workflow/gates/GateSystem.d.ts +12 -1
  91. package/dist/workflow/gates/GateSystem.js +106 -0
  92. package/dist/workflow/gates/GateSystem.js.map +1 -1
  93. package/dist/workflow/types.d.ts +1 -1
  94. package/docs/CODE_INTELLIGENCE.md +138 -0
  95. package/docs/CONTEXT_BUDGET.md +87 -0
  96. package/docs/GOVERNANCE_DASHBOARD.md +69 -0
  97. package/docs/MEMORY_BRAIN.md +104 -0
  98. package/docs/MEMORY_FABRIC.md +107 -0
  99. package/docs/README.md +76 -0
  100. package/docs/RUNTIME_EVIDENCE.md +101 -0
  101. package/docs/SKILL_RADAR.md +115 -0
  102. package/docs/WORKFLOW_EVAL.md +151 -0
  103. package/docs/start/README.md +42 -0
  104. package/docs/start/agent-governance-demo.md +107 -0
  105. package/docs/start/quickstart.md +127 -0
  106. package/examples/demo-projects/agent-governance-demo/README.md +37 -0
  107. package/examples/demo-projects/agent-governance-demo/package.json +16 -0
  108. package/examples/demo-projects/agent-governance-demo/src/oauth-state.ts +39 -0
  109. package/examples/demo-projects/agent-governance-demo/tests/oauth-state.test.ts +52 -0
  110. package/package.json +14 -3
package/README.md CHANGED
@@ -1,78 +1,85 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.15.1-orange?style=flat-square" alt="version" />
2
+ <img src="https://img.shields.io/badge/version-0.20.0-orange?style=flat-square" alt="version" />
3
3
  <img src="https://img.shields.io/badge/platforms-16-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
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-822-passing-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.15.1-cb3837?style=flat-square&logo=npm" alt="npm" />
7
+ <img src="https://img.shields.io/badge/tests-verified-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.20.0-cb3837?style=flat-square&logo=npm" alt="npm" />
9
9
  </p>
10
10
 
11
- # SCALE Engine v0.15.1
11
+ # SCALE Engine v0.20.0
12
12
 
13
- SCALE Engine 是一个面向 AI 编码 Agent 的工程化工作流运行时。它把提示词里的工程纪律,下沉为状态机、质量门禁、持久化证据、确定性 review 记录和发布检查。
13
+ SCALE Engine AI Agent 不再只靠“自觉”遵守工程规范。它把探索、规划、实现、验证、评审、发版这些要求变成可执行的命令、门禁和证据文件,让人类可以看见 Agent 做了什么、跳过了什么、为什么不能交付。
14
14
 
15
15
  源码仓库:https://github.com/hongmaple0820/scale-engine
16
16
  国内镜像:https://gitee.com/hongmaple/scale-engine
17
17
  npm:https://www.npmjs.com/package/@hongmaple0820/scale-engine
18
18
  语言:[中文](README.md) | [English](README.en.md)
19
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.15.1 聚焦生产级工程治理模板:
32
-
33
- - 支持 MOE / 非 MOE 工作区拓扑、子仓库变更阻断、临时 worktree 清理候选识别。
34
- - 增加资源资产治理,区分长期维护文档、版本化产物、任务证据、临时文件和禁止提交资产。
35
- - 增加工程规范扫描,覆盖日志噪音、敏感信息脱敏、安全输入、ORM/数据库、框架组件和测试验证。
36
- - 增强技能与工具编排,UI/UX、联网研究、浏览器 E2E、桌面自动化、外部 Agent CLI 都有路由和证据契约。
37
- - `scale init` / governance pack 会生成 service matrix、verification profile、artifact 模板、metrics、resource policy、engineering standards 和 tool orchestration 规则。
38
-
39
- 历史 v0.11.1 新增四大优先级改进:
40
-
41
- ### Phase Commands FSM 阻断
42
- - `canTransition` + `process.exit(1)` 确保 FSM guard 失败时阻塞流程,而非继续执行
43
- - define/plan/build/verify 各阶段添加明确的阻断提示
44
-
45
- ### OWASP Top 10 检测器
46
- - 新增 `OWASPDetector` 覆盖 SQL 注入、XSS、路径遍历、SSRF、Auth Bypass、弱加密、CORS 错误配置、CSRF、文件上传、敏感数据泄露
47
- - 19 类安全检测模式,自动识别 regex 定义避免误报
48
-
49
- ### Browser QA Capability
50
- - `BrowserQACapability` 封装 Playwright MCP 工具
51
- - 支持导航、点击、截图、console 检查、E2E 测试流程
52
-
53
- ### L6 Evolution 自改进闭环
54
- - `LessonExtractor` 从会话 Defect 事件提取可复用教训
55
- - `SelfImproveEngine` 实现 `Defect Lesson Rule → Hook` 晋升流水线
56
- - 新增 CLI 命令:`scale evolution extract/improve/report/hooks`
57
-
58
- ---
59
-
60
- **完整阶段化交付链路**:
61
-
62
- - `define -> plan -> build -> verify -> review -> ship`
63
- - Spec、Plan、Task artifact 接入 FSM,guard 失败时阻断而非继续
64
- - 验证门禁证据持久化
65
- - 代码 review 记录持久化
66
- - 确定性 review scanner 会阻断空 `catch`、`@ts-ignore`、focused test、危险 shell/git 命令和缺 G7 证据的安全敏感变更
67
- - OWASP Top 10 安全检测器扩展安全覆盖
68
- - G7 内置安全扫描会记录可解释的文件/行号证据,默认阻断 CRITICAL,严格模式可阻断 HIGH
69
- - 可选严格 TDD evidence 门禁:`--tdd-evidence` 和 `--tdd-strict`
70
- - `ship --no-commit` 交付报告
71
- - `ship` 发布前强制验证 review evidence
72
- - 16 个平台适配器,12 个专业 Agent Profile
73
- - Browser QA Capability (Playwright MCP)
74
- - Evolution 自改进闭环
75
- - 本轮加固后,499 Vitest 测试通过
20
+ ## 它解决什么问题
21
+
22
+ AI 编码真正难的不是“写代码”,而是持续稳定地遵守工程纪律:
23
+
24
+ | 常见问题 | SCALE 的处理方式 |
25
+ | --- | --- |
26
+ | Agent 没验证却说“测试通过” | 通过 verification profile 和 evidence store 记录真实命令与结果 |
27
+ | Agent 跳过需求澄清、设计、TDD review | 通过 `scale context`、`scale diagnose`、`scale tdd`、`scale status` 生成下一步动作 |
28
+ | Agent 误提交无关文件或跨仓库改错位置 | 通过 review-gated ship、MOE workspace 和子仓库 blocker 控制边界 |
29
+ | 文档、报告、截图、临时脚本越堆越乱 | 通过 resource governance 区分长期维护、任务证据、临时产物和禁止提交资产 |
30
+ | 日志噪音、敏感信息、ORM/框架乱用、安全风险无人兜底 | 通过 engineering standards 和 OWASP 扫描给出可追溯问题 |
31
+ | Markdown 长报告没人读 | 通过 `scale artifact` 从 Markdown 源文件生成可追溯 HTML 报告 |
32
+
33
+ ## 3 分钟看到效果
34
+
35
+ ```bash
36
+ npm install -g @hongmaple0820/scale-engine
37
+ mkdir scale-demo && cd scale-demo
38
+ scale init --governance-pack standard
39
+ scale preflight --preflight-profile quick
40
+ scale status
41
+ ```
42
+
43
+ 你会得到一套可提交到项目里的治理文件:
44
+
45
+ - `.scale/verification.json`:服务矩阵和验证 profile
46
+ - `.scale/skills.json`:skill 路由和证据要求
47
+ - `.scale/tools.json`:CLI/MCP/browser/desktop 工具编排规则
48
+ - `docs/workflow/templates/`:Mini-PRD、plan、verification、review、summary 模板
49
+ - `docs/standards/`:工程规范、Git 协作、资源治理规则
50
+
51
+ 继续体验完整闭环:
52
+
53
+ ```bash
54
+ scale context init --name "Scale Demo"
55
+ scale context grill --task-id 2026-05-18-oauth-hardening --task "加固 OAuth callback"
56
+ scale diagnose plan --task-id 2026-05-18-oauth-hardening --symptom "callback state 过期时返回 500"
57
+ scale tdd slice --task-id 2026-05-18-oauth-hardening --behavior "拒绝过期 OAuth state" --public-interface "GET /oauth/callback" --failing-test "expired state returns 401" --test-file tests/oauth.test.ts --impl-files src/oauth.ts
58
+ scale artifact render --task-id 2026-05-18-oauth-hardening --artifact-dir docs/worklog/tasks/2026-05-18-oauth-hardening
59
+ scale artifact doctor --artifact-dir docs/worklog/tasks/2026-05-18-oauth-hardening
60
+ ```
61
+
62
+ 完整教程见 [3 分钟快速开始](docs/start/quickstart.md) [官方 Demo Walkthrough](docs/start/agent-governance-demo.md)。
63
+
64
+ ## 适合谁
65
+
66
+ - 正在用 Codex、Claude Code、Cursor、Gemini CLI、OpenCode、Aider Agent 写真实项目的团队。
67
+ - 有多服务、多仓库、MOE workspace、前后端分离、脚手架治理需求的团队。
68
+ - 希望 Agent 主动使用 skills、MCP、CLI、浏览器、E2E、HTML 报告,但又需要安全边界和证据闭环的团队。
69
+ - 经常遇到“AI 改得快,但难审、难验、难维护”的项目负责人。
70
+
71
+ 不适合只想要一个极简 prompt 文件、完全不需要门禁、不关心多人协作和长期维护的玩具项目。
72
+
73
+ ## 核心能力
74
+
75
+ - Workflow Engine:`define -> plan -> build -> verify -> review -> ship` 的阶段化交付状态机。
76
+ - GateSystem:build、lint、test、coverage、security、TDD、review、tool evidence 等门禁。
77
+ - Governance Packs:`standard`、`project-scaffold`、`moe-workspace`、`resource-governance`、`go-service-matrix`、`node-library`、`frontend-app`。
78
+ - Resource Governance:治理文档、图片、视频、报告、测试脚本、临时脚本、HTML artifact 和本地配置。
79
+ - Skill and Tool Orchestration:把 UI/UX、联网研究、浏览器 E2E、Chrome DevTools MCP、桌面自动化、外部 Agent CLI 纳入流程。
80
+ - Runtime Evidence:记录会话、命令、工具、浏览器、skill 和最终交付证据,阻断“没有证据却声称完成”。
81
+ - Engineering Standards:扫描日志噪音、敏感信息、注入风险、ORM/数据库、框架边界、测试严谨性和部署风险。
82
+ - HTML Artifacts:Markdown 仍是可维护源文件,HTML 用于评审、对比、状态报告和发版交接。
76
83
 
77
84
  ## 安装
78
85
 
@@ -83,6 +90,36 @@ scale --version
83
90
 
84
91
  需要 Node.js 20 或更高版本。
85
92
 
93
+ ## Governance Pack
94
+
95
+ 在已有项目中安装治理工作流:
96
+
97
+ ```bash
98
+ scale init --governance-pack standard
99
+ scale init --governance-pack project-scaffold
100
+ scale init --governance-pack moe-workspace
101
+ scale init --governance-pack resource-governance
102
+ scale init --governance-pack go-service-matrix
103
+ scale init --governance-pack node-library
104
+ scale init --governance-pack frontend-app
105
+ ```
106
+
107
+ 当前支持的治理包:
108
+
109
+ | Pack | 适用场景 |
110
+ | --- | --- |
111
+ | `standard` | 通用项目治理,包含任务 artifact、验证、指标、资源、规范和 skills policy |
112
+ | `project-scaffold` | 可复现的工程化工作流脚手架和治理 demo 项目 |
113
+ | `moe-workspace` | 父工作区 + 独立子仓库,适合 MOE/多仓协作 |
114
+ | `resource-governance` | 文档、报告、截图、脚本、媒体、生成产物等资源生命周期治理 |
115
+ | `go-service-matrix` | Go 后端服务矩阵,支持按服务 build/lint/test/security 验证 |
116
+ | `node-library` | Node/TypeScript 包的开发、发布和验证治理 |
117
+ | `frontend-app` | UI/UX、浏览器证据、响应式检查、E2E 和视觉评审治理 |
118
+
119
+ 如果不确定选哪个,先用 `standard`。场景明确时再使用更具体的 pack:
120
+
121
+ 更多命令和使用路径见 [入门文档索引](docs/start/README.md)。
122
+
86
123
  ## Vibe Templates(一键启动)
87
124
 
88
125
  内置高质量提示词模板,无需输入复杂指令:
@@ -139,6 +176,129 @@ scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
139
176
 
140
177
  TDD evidence JSON 需要包含 `red`、`green`、`refactor`、`testFirst` 且值都为 `true`。
141
178
 
179
+ ## Memory Fabric
180
+
181
+ Memory Fabric 会在长会话中把 runtime evidence、session events、knowledge recall 和 graph status 压缩成可预算的 context pack:
182
+
183
+ ```bash
184
+ scale memory pack --task "Fix OAuth callback state lookup" --task-id <task-id> --session-id <session-id> --level M --budget 4000
185
+ scale memory doctor --task "Review cross-module permission change" --level L --budget 3000
186
+ scale memory settle --task "Fix OAuth callback state lookup" --task-id <task-id> --session-id <session-id> --level M
187
+ ```
188
+
189
+ `memory settle` 会把已记录的运行证据沉淀为 `.scale/memory/learning-candidates/` 下的学习候选。候选默认需要人审,避免把一次会话里的临时判断直接污染长期知识库。
190
+
191
+ 详见 [Memory Fabric](docs/MEMORY_FABRIC.md)。
192
+
193
+ ## Context Budget 与 Progressive Governance
194
+
195
+ Context Budget 会把 always-loaded、on-demand、evidence、archive、generated 上下文分开统计,避免 Agent 把所有规则、历史方案、报告和生成物一次性塞进提示词。
196
+
197
+ ```bash
198
+ scale context budget --json
199
+ scale context doctor --max-always 2500 --max-task 8000
200
+ scale context pack --task "Review frontend route with browser evidence" --level L --budget 4000 --json
201
+ ```
202
+
203
+ Progressive Governance 会根据任务文本和变更文件自动推荐 `minimal`、`standard`、`expanded` 或 `critical` 治理模式,并用 ROI 报告解释治理收益和开销:
204
+
205
+ ```bash
206
+ scale governance mode --task "Change auth permissions" --files src/auth/user.ts --requested-mode minimal --json
207
+ scale governance roi --task-id <task-id> --task "Review frontend route" --files src/routes/upload.tsx --json
208
+ ```
209
+
210
+ 详见 [Context Budget And Progressive Governance](docs/CONTEXT_BUDGET.md)。
211
+
212
+ ## Code Intelligence 与探索 ROI
213
+
214
+ Code Intelligence 是 adapter-first 的代码理解层:优先消费外部 CodeGraph 或 Graphify 产物,缺失时明确降级到内部 source scan,不静默假装已经完成代码图谱分析。
215
+
216
+ ```bash
217
+ scale codegraph init
218
+ scale codegraph status --json
219
+ scale codegraph query "UserService.create" --json
220
+ scale codegraph impact --symbol UserService.create --json
221
+ scale codegraph context --symbol UserService.create --budget 2000 --json
222
+ scale codegraph roi --symbol UserService.create --json
223
+ ```
224
+
225
+ 它会输出 provider、fallback 状态、相关文件、confidence,以及 `fileReadsSaved` / `toolCallsSaved` 等探索收益指标。`scale governance roi` 也可以通过 `--symbol` 或 `--code-query` 把代码智能纳入治理 ROI。
226
+
227
+ 详见 [Code Intelligence](docs/CODE_INTELLIGENCE.md)。
228
+
229
+ ## Workflow Eval 与 Failure Replay
230
+
231
+ Workflow Eval 用轻量套件衡量工作流是否真的减少返工、工具调用、token 消耗和人类纠偏。失败时会保留 Failure Replay,而不是只留下一个失败状态。
232
+
233
+ ```bash
234
+ scale eval init
235
+ scale eval run --suite workflow-baseline --json
236
+ scale eval compare --baseline <run-id> --candidate <run-id> --json
237
+ scale eval failures --since 30d --json
238
+ scale eval promote-failure <failure-id>
239
+ ```
240
+
241
+ 默认产物写入 `.scale/evals/`,属于本地运行时证据。长期提交到 Git 的应是经过整理的报告、基准 fixture 或明确要沉淀的改进项。
242
+
243
+ 详见 [Workflow Eval Harness](docs/WORKFLOW_EVAL.md)。
244
+
245
+ ## Skill Radar
246
+
247
+ Skill Radar chooses skills, MCP, browser automation, desktop automation, and external CLIs by task intent instead of relying on a static prompt list. It returns confidence, safety level, evidence requirements, and fallback behavior so agents can actively use tools without silently crossing safety boundaries.
248
+
249
+ ```bash
250
+ scale skill radar --task "Design upload UI and run browser E2E checks" --files src/pages/upload.tsx
251
+ scale skill radar --task "Automate WPS desktop workflow with CUA" --json
252
+ scale skill doctor --supply-chain
253
+ ```
254
+
255
+ Desktop CUA and external agent CLIs are blocked by default through Tool Policy until deliberately enabled. Third-party skills stay review-required until source, scripts, license, and pinned revision are checked.
256
+
257
+ See [Skill Radar](docs/SKILL_RADAR.md).
258
+
259
+ ## Memory Brain
260
+
261
+ Memory Brain stores long-term project knowledge separately from the short context pack. Runtime evidence and learning candidates enter as candidates first; active memory requires evidence paths, project scope, confidence, and explicit promotion.
262
+
263
+ ```bash
264
+ scale memory ingest --from evidence --task-id <task-id>
265
+ scale memory ingest --from failure --failure-id <failure-replay-id>
266
+ scale memory query "OAuth callback state design"
267
+ scale memory contradictions --json
268
+ scale memory dream --json
269
+ scale memory promote <candidate-id>
270
+ ```
271
+
272
+ The point is not to remember everything. The point is to keep useful, reviewed project facts while reporting contradictions instead of silently overwriting them.
273
+
274
+ See [Memory Brain](docs/MEMORY_BRAIN.md).
275
+
276
+ ## Governance Dashboard
277
+
278
+ Governance Dashboard renders a local HTML health view from runtime evidence, Workflow Eval, Memory Brain, Resource Governance, and task HTML artifacts:
279
+
280
+ ```bash
281
+ scale artifact dashboard
282
+ scale artifact dashboard --task-id <task-id> --json
283
+ ```
284
+
285
+ Default output is `.scale/reports/governance-dashboard.html`. Markdown and JSON remain the maintainable source of truth; the dashboard is a review surface for humans.
286
+
287
+ See [Governance Dashboard](docs/GOVERNANCE_DASHBOARD.md).
288
+
289
+ ## Runtime Evidence
290
+
291
+ M/L/CRITICAL 任务在最终交付前应留下运行时证据,避免 Agent 没有真实验证就声称完成:
292
+
293
+ ```bash
294
+ scale runtime start --session-id <session-id> --task-id <task-id> --level M --agent codex
295
+ scale runtime record --title "build" --kind command --status passed --command "npm run build" --exit-code 0 --summary "build passed"
296
+ scale runtime final-check --task-id <task-id> --session-id <session-id> --level M
297
+ scale runtime doctor --task-id <task-id> --session-id <session-id> --level M
298
+ ```
299
+
300
+ 证据写入 `.scale/events/sessions/` 和 `.scale/evidence/runtime/`,默认属于本地运行时产物,不应提交到 Git。详见 [Runtime Evidence](docs/RUNTIME_EVIDENCE.md)。
301
+
142
302
  ## Evolution 自改进闭环
143
303
 
144
304
  从会话缺陷中提取教训,晋升为规则和 Hook:
@@ -214,7 +374,7 @@ src/guardrails/ detector 与 gateway
214
374
  src/guardrails/OWASPDetector.ts OWASP Top 10 安全检测
215
375
  src/capabilities/BrowserQACapability.ts Playwright MCP 包装器
216
376
  src/evolution/ Defect/Lesson/Rule/Hook 自进化层
217
- tests/ Vitest 测试 (499 tests)
377
+ tests/ Vitest 测试套件
218
378
  ```
219
379
 
220
380
  ## 开发与验证
@@ -233,6 +393,38 @@ npx vitest run tests/workflow/phaseCli.test.ts
233
393
  npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.test.ts tests/workflow/gateSystem.test.ts
234
394
  ```
235
395
 
396
+ ## v0.20.0 Updates
397
+
398
+ - Added Context Budget and Progressive Governance so low-risk S tasks stay lightweight while auth, data, security, deployment, and cross-module changes escalate automatically.
399
+ - Added Code Intelligence with adapter-first CodeGraph / Graphify support, explicit fallback, impact analysis, context recommendations, and exploration ROI.
400
+ - Added Workflow Eval, Failure Replay, and improvement candidates with pass@k, fix iterations, tool-call counts, token estimates, and human-correction metrics.
401
+ - Added Skill Radar for intent-based skills, MCP, browser, desktop automation, and external CLI recommendations with confidence, safety level, and evidence requirements.
402
+ - Added Memory Brain for evidence-backed long-term memory candidates, contradiction detection, dream maintenance, explicit promotion, and failure replay ingestion.
403
+ - Added Governance Dashboard to summarize runtime, eval, memory, resource, and HTML artifact evidence in a local HTML review surface.
404
+ - Fixed new --dir-aware commands so relative .scale state resolves inside the target project instead of the caller workspace.
405
+
406
+ ## v0.18.0 更新
407
+
408
+ - 新增受治理 HTML artifact:`scale artifact render/doctor/settle/open`。
409
+ - Markdown 保持为可维护源文件;生成 HTML 作为可追溯任务证据。
410
+ - governance pack 增加 output policy 和 HTML artifact 资源分类。
411
+ - 增加 HTML 渲染、安全检查、settlement evidence 和模板生成测试。
412
+
413
+ ## v0.17.0 更新
414
+
415
+ - 新增主动工作流命令门控:`scale context`、`scale diagnose`、`scale tdd`、`scale status`。
416
+ - 增加 required next-action queue,减少 Agent 静默跳过上下文、调试、TDD 或验证步骤。
417
+
418
+ ## v0.16.0 更新
419
+
420
+ - 新增受治理 skill repository、skill 推荐、安装安全检查、可视化 Vibe 模板和领导者角色预设。
421
+ - 加强工具编排、资源治理和工程规范治理。
422
+
423
+ ## v0.15.1 更新
424
+
425
+ - 新增 UI/UX、联网研究、浏览器自动化、桌面自动化和外部 Agent CLI 路由契约。
426
+ - 为生成项目包增加资源治理和工程规范治理。
427
+
236
428
  ## v0.11.1 更新
237
429
 
238
430
  - Phase Commands FSM 阻断:`canTransition` + `process.exit(1)` 确保 guard 失败时阻塞
@@ -241,7 +433,7 @@ npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.
241
433
  - L6 Evolution:`Defect → Lesson → Rule → Hook` 自改进闭环
242
434
  - Evolution CLI:`scale evolution extract/improve/report/hooks`
243
435
  - ReviewAnalyzer regex 修复:避免模式定义误报
244
- - 499 测试通过
436
+ - Vitest 测试套件纳入发布验证
245
437
 
246
438
  ## v0.10.1 更新
247
439