@hongmaple0820/scale-engine 0.25.0 → 0.27.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 (171) hide show
  1. package/LICENSE +15 -15
  2. package/README.en.md +384 -346
  3. package/README.md +564 -529
  4. package/dist/adapters/AiderAdapter.js +52 -52
  5. package/dist/adapters/AntigravityAdapter.d.ts +4 -0
  6. package/dist/adapters/AntigravityAdapter.js +21 -0
  7. package/dist/adapters/AntigravityAdapter.js.map +1 -0
  8. package/dist/adapters/ClaudeCodeAdapter.d.ts +4 -1
  9. package/dist/adapters/ClaudeCodeAdapter.js +34 -34
  10. package/dist/adapters/ClaudeCodeAdapter.js.map +1 -1
  11. package/dist/adapters/ClineAdapter.d.ts +4 -0
  12. package/dist/adapters/ClineAdapter.js +20 -0
  13. package/dist/adapters/ClineAdapter.js.map +1 -0
  14. package/dist/adapters/CodexAdapter.js +28 -28
  15. package/dist/adapters/CursorAdapter.js +26 -26
  16. package/dist/adapters/DeepSeekTuiAdapter.js +97 -97
  17. package/dist/adapters/DoubaoAdapter.js +33 -33
  18. package/dist/adapters/GeminiAdapter.js +26 -26
  19. package/dist/adapters/GenericProjectAgentAdapter.d.ts +29 -0
  20. package/dist/adapters/GenericProjectAgentAdapter.js +204 -0
  21. package/dist/adapters/GenericProjectAgentAdapter.js.map +1 -0
  22. package/dist/adapters/HermesAdapter.js +26 -26
  23. package/dist/adapters/JCodeAdapter.d.ts +4 -0
  24. package/dist/adapters/JCodeAdapter.js +19 -0
  25. package/dist/adapters/JCodeAdapter.js.map +1 -0
  26. package/dist/adapters/KiloCodeAdapter.d.ts +4 -0
  27. package/dist/adapters/KiloCodeAdapter.js +20 -0
  28. package/dist/adapters/KiloCodeAdapter.js.map +1 -0
  29. package/dist/adapters/KimiAdapter.js +32 -32
  30. package/dist/adapters/KiroAdapter.js +26 -26
  31. package/dist/adapters/OpenClawAdapter.js +26 -26
  32. package/dist/adapters/OpenCodeAdapter.js +26 -26
  33. package/dist/adapters/QCoderAdapter.js +26 -26
  34. package/dist/adapters/QoderAdapter.d.ts +4 -0
  35. package/dist/adapters/QoderAdapter.js +21 -0
  36. package/dist/adapters/QoderAdapter.js.map +1 -0
  37. package/dist/adapters/TraeAdapter.js +26 -26
  38. package/dist/adapters/VSCAdapter.js +26 -26
  39. package/dist/adapters/WindsurfAdapter.js +32 -32
  40. package/dist/adapters/WorkBuddyAdapter.js +26 -26
  41. package/dist/adapters/index.d.ts +5 -0
  42. package/dist/adapters/index.js +15 -0
  43. package/dist/adapters/index.js.map +1 -1
  44. package/dist/api/cli.js +190 -56
  45. package/dist/api/cli.js.map +1 -1
  46. package/dist/api/doctor.js +10 -3
  47. package/dist/api/doctor.js.map +1 -1
  48. package/dist/api/quickstart.js +7 -1
  49. package/dist/api/quickstart.js.map +1 -1
  50. package/dist/artifact/sqliteStore.js +89 -89
  51. package/dist/artifact/types.d.ts +1 -1
  52. package/dist/cli/phaseCommands.js +53 -53
  53. package/dist/cli/phaseCommands.js.map +1 -1
  54. package/dist/context/AntiPatternRegistry.js +20 -20
  55. package/dist/context/ContextBudget.d.ts +14 -0
  56. package/dist/context/ContextBudget.js +50 -14
  57. package/dist/context/ContextBudget.js.map +1 -1
  58. package/dist/context/ContextBuilder.js +155 -155
  59. package/dist/context/ContextCompiler.d.ts +34 -0
  60. package/dist/context/ContextCompiler.js +120 -0
  61. package/dist/context/ContextCompiler.js.map +1 -0
  62. package/dist/eval/WorkflowEval.js +4 -6
  63. package/dist/eval/WorkflowEval.js.map +1 -1
  64. package/dist/evolution/EvolutionEngine.js +31 -31
  65. package/dist/evolution/EvolutionEvaluator.d.ts +2 -0
  66. package/dist/evolution/EvolutionEvaluator.js +7 -1
  67. package/dist/evolution/EvolutionEvaluator.js.map +1 -1
  68. package/dist/fsm/FSMAgentBridge.js +11 -11
  69. package/dist/governance/GovernanceRoi.d.ts +6 -1
  70. package/dist/governance/GovernanceRoi.js +32 -0
  71. package/dist/governance/GovernanceRoi.js.map +1 -1
  72. package/dist/guardrails/DependencyAuditor.js +38 -0
  73. package/dist/guardrails/DependencyAuditor.js.map +1 -1
  74. package/dist/hooks/HookGeneratorEnhanced.js +218 -218
  75. package/dist/index.d.ts +2 -1
  76. package/dist/index.js +3 -2
  77. package/dist/index.js.map +1 -1
  78. package/dist/knowledge/SQLiteKnowledgeBase.js +28 -28
  79. package/dist/memory/MemoryBrain.js +52 -52
  80. package/dist/output/GovernanceDashboard.js +44 -44
  81. package/dist/output/HTMLArtifactLayer.js +31 -31
  82. package/dist/prompts/VibeTemplateGallery.js +121 -121
  83. package/dist/runtime/AiOsRuntime.d.ts +53 -0
  84. package/dist/runtime/AiOsRuntime.js +142 -0
  85. package/dist/runtime/AiOsRuntime.js.map +1 -0
  86. package/dist/runtime/index.d.ts +1 -0
  87. package/dist/runtime/index.js +1 -0
  88. package/dist/runtime/index.js.map +1 -1
  89. package/dist/skills/SkillDiscovery.js +12 -1
  90. package/dist/skills/SkillDiscovery.js.map +1 -1
  91. package/dist/skills/routing/SkillPlanner.js +128 -40
  92. package/dist/skills/routing/SkillPlanner.js.map +1 -1
  93. package/dist/skills/routing/SkillRoutingTypes.d.ts +17 -0
  94. package/dist/tools/SafeCommandRunner.d.ts +16 -0
  95. package/dist/tools/SafeCommandRunner.js +83 -0
  96. package/dist/tools/SafeCommandRunner.js.map +1 -0
  97. package/dist/workflow/EngineeringStandards.js +62 -62
  98. package/dist/workflow/GovernanceTemplatePacks.d.ts +1 -1
  99. package/dist/workflow/GovernanceTemplatePacks.js +1990 -162
  100. package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
  101. package/dist/workflow/GovernanceTemplates.d.ts +2 -0
  102. package/dist/workflow/GovernanceTemplates.js +1012 -1001
  103. package/dist/workflow/GovernanceTemplates.js.map +1 -1
  104. package/dist/workflow/ResourceGovernance.js +16 -16
  105. package/dist/workflow/TaskArtifactScaffolder.js +10 -10
  106. package/dist/workflow/UpgradeManager.d.ts +3 -2
  107. package/dist/workflow/UpgradeManager.js +134 -49
  108. package/dist/workflow/UpgradeManager.js.map +1 -1
  109. package/dist/workflow/WorkspaceTopology.js +18 -15
  110. package/dist/workflow/WorkspaceTopology.js.map +1 -1
  111. package/dist/workflow/gates/GateSystem.js +3 -9
  112. package/dist/workflow/gates/GateSystem.js.map +1 -1
  113. package/docs/ACTIVE_SECURITY_VISUAL_GATES.md +87 -87
  114. package/docs/AI_ENGINEERING_OS_POSITIONING.md +462 -0
  115. package/docs/BACKGROUND_HUNTER.md +62 -62
  116. package/docs/CODE_INTELLIGENCE.md +138 -138
  117. package/docs/CONTEXT_BUDGET.md +155 -113
  118. package/docs/DEPENDENCY_AUDIT.md +118 -89
  119. package/docs/EVOLUTION_SHADOW_MODE.md +63 -63
  120. package/docs/EXTERNAL_REFERENCES.md +63 -58
  121. package/docs/GITLAB_FLOW.md +125 -125
  122. package/docs/GOVERNANCE_DASHBOARD.md +85 -85
  123. package/docs/MEMORY_BRAIN.md +104 -104
  124. package/docs/MEMORY_FABRIC.md +136 -134
  125. package/docs/README.md +102 -92
  126. package/docs/RUNTIME_EVIDENCE.md +101 -101
  127. package/docs/SKILL-REPOSITORY.md +57 -57
  128. package/docs/SKILL_RADAR.md +135 -122
  129. package/docs/THIRD_PARTY_SKILLS.md +57 -57
  130. package/docs/WORKFLOW_EVAL.md +151 -151
  131. package/docs/guides/DEVELOPMENT_WORKFLOW.md +80 -0
  132. package/docs/guides/GETTING_STARTED.md +50 -0
  133. package/docs/start/README.md +78 -72
  134. package/docs/start/agent-governance-demo.md +107 -107
  135. package/docs/start/quickstart.md +137 -127
  136. package/docs/start/workflow-upgrade.md +32 -8
  137. package/docs/workflow/README.md +67 -0
  138. package/docs/workflow/node-library.md +52 -0
  139. package/docs/workflow/templates/api-contract.md +29 -0
  140. package/docs/workflow/templates/architecture-review.md +23 -0
  141. package/docs/workflow/templates/db-change-plan.md +20 -0
  142. package/docs/workflow/templates/docs-impact.md +17 -0
  143. package/docs/workflow/templates/e2e-plan.md +20 -0
  144. package/docs/workflow/templates/explore.md +16 -0
  145. package/docs/workflow/templates/github-actions-scale-preflight.yml +32 -0
  146. package/docs/workflow/templates/mini-prd.md +16 -0
  147. package/docs/workflow/templates/plan.md +37 -0
  148. package/docs/workflow/templates/pre-push-scale-preflight.sh +8 -0
  149. package/docs/workflow/templates/product-smoke.md +61 -0
  150. package/docs/workflow/templates/reality-check.md +28 -0
  151. package/docs/workflow/templates/resource-cleanup.md +17 -0
  152. package/docs/workflow/templates/resource-impact.md +25 -0
  153. package/docs/workflow/templates/review.md +12 -0
  154. package/docs/workflow/templates/runtime.md +23 -0
  155. package/docs/workflow/templates/security-review.md +26 -0
  156. package/docs/workflow/templates/skill-evidence.md +33 -0
  157. package/docs/workflow/templates/skill-plan.md +39 -0
  158. package/docs/workflow/templates/spec.md +17 -0
  159. package/docs/workflow/templates/standards-impact.md +28 -0
  160. package/docs/workflow/templates/summary.md +16 -0
  161. package/docs/workflow/templates/tasks.md +8 -0
  162. package/docs/workflow/templates/ui-spec.md +29 -0
  163. package/docs/workflow/templates/verification.md +20 -0
  164. package/docs/workflow/templates/visual-review.md +20 -0
  165. package/examples/demo-projects/agent-governance-demo/CONTEXT.md +14 -14
  166. package/examples/demo-projects/agent-governance-demo/README.md +48 -48
  167. package/examples/demo-projects/agent-governance-demo/docs/CONTEXT-MAP.md +14 -14
  168. package/examples/demo-projects/agent-governance-demo/package.json +22 -21
  169. package/examples/demo-projects/agent-governance-demo/src/oauth-state.ts +39 -39
  170. package/examples/demo-projects/agent-governance-demo/tests/oauth-state.test.ts +52 -52
  171. package/package.json +95 -78
package/README.en.md CHANGED
@@ -1,346 +1,384 @@
1
- <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.23.0-orange?style=flat-square" alt="version" />
3
- <img src="https://img.shields.io/badge/platforms-16-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-verified-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.23.0-cb3837?style=flat-square&logo=npm" alt="npm" />
9
- </p>
10
-
11
- # SCALE Engine v0.23.0
12
-
13
- SCALE Engine makes AI coding agents follow engineering rules through executable workflow gates, evidence files, and review constraints instead of relying on prompt discipline alone. It helps humans see what the agent explored, planned, verified, skipped, and why a task is or is not ready to ship.
14
-
15
- Repository: https://github.com/hongmaple0820/scale-engine
16
- Mirror: https://gitee.com/hongmaple/scale-engine
17
- npm: https://www.npmjs.com/package/@hongmaple0820/scale-engine
18
- Language: [English](README.en.md) | [Chinese](README.md)
19
-
20
- ## Community
21
-
22
- SCALE Engine is an engineering workflow governance project for real AI-agent delivery. Contributions, issues, PRs, governance-pack ideas, and field reports are welcome through the source repositories. Chinese users can also follow the WeChat public account for updates, examples, and community entry points.
23
-
24
- | Platform | Link | Purpose |
25
- | --- | --- | --- |
26
- | GitHub | [https://github.com/hongmaple0820/scale-engine](https://github.com/hongmaple0820/scale-engine) | Source, issues, and PRs |
27
- | Gitee | [https://gitee.com/hongmaple/scale-engine](https://gitee.com/hongmaple/scale-engine) | China mirror and feedback |
28
- | npm | [https://www.npmjs.com/package/@hongmaple0820/scale-engine](https://www.npmjs.com/package/@hongmaple0820/scale-engine) | CLI package |
29
-
30
- <p align="center">
31
- <img src="image/wechat-public.jpg" alt="SCALE Engine WeChat public account" width="220" />
32
- </p>
33
-
34
- ## Sponsorship
35
-
36
- If SCALE Engine saves engineering governance time for your team, or helps move AI-agent work into a verifiable, reviewable, and releasable loop, voluntary sponsorship is welcome. Sponsorship supports maintenance, examples, documentation, test coverage, and community support. It is not a commercial support contract and does not change issue or PR priority.
37
-
38
- <p align="center">
39
- <img src="image/wxPay.jpg" alt="Sponsor with WeChat Pay" width="220" />
40
- &nbsp;&nbsp;
41
- <img src="image/zfb.jpg" alt="Sponsor with Alipay" width="220" />
42
- </p>
43
-
44
- ## What It Solves
45
-
46
- AI coding becomes hard when agents must behave consistently across real teams and real repositories:
47
-
48
- | Failure mode | SCALE mechanism |
49
- | --- | --- |
50
- | Agent says tests passed without running them | Verification profiles and evidence stores record actual commands and results |
51
- | Agent skips discovery, design, TDD, or review | `scale context`, `scale diagnose`, `scale tdd`, and `scale status` produce required next actions |
52
- | Agent stages unrelated files or edits the wrong repository | Review-gated shipping, MOE workspace rules, and child repository blockers control boundaries |
53
- | Docs, screenshots, reports, scripts, and temporary files become unmaintainable | Resource governance classifies maintained assets, task evidence, temporary outputs, and forbidden commits |
54
- | Noisy logs, secrets, ORM misuse, framework violations, or security risks slip through | Engineering standards and OWASP scans produce traceable findings |
55
- | Long Markdown reports are not read | `scale artifact` renders traceable HTML reports from maintained Markdown sources |
56
-
57
- ## See It In 3 Minutes
58
-
59
- ```bash
60
- npm install -g @hongmaple0820/scale-engine
61
- mkdir scale-demo && cd scale-demo
62
- scale init --governance-pack standard
63
- scale preflight --preflight-profile quick
64
- scale status
65
- ```
66
-
67
- This generates governance files you can commit to a project:
68
-
69
- - `.scale/verification.json`: service matrix and verification profiles
70
- - `.scale/skills.json`: skill routing and evidence requirements
71
- - `.scale/tools.json`: CLI/MCP/browser/desktop orchestration policy
72
- - `docs/workflow/templates/`: Mini-PRD, plan, verification, review, and summary templates
73
- - `docs/standards/`: engineering, Git collaboration, and resource governance rules
74
-
75
- Continue with a full workflow loop:
76
-
77
- ```bash
78
- scale context init --name "Scale Demo"
79
- scale context grill --task-id 2026-05-18-oauth-hardening --task "Harden OAuth callback"
80
- scale diagnose plan --task-id 2026-05-18-oauth-hardening --symptom "callback returns 500 when state expires"
81
- scale tdd slice --task-id 2026-05-18-oauth-hardening --behavior "reject expired OAuth state" --public-interface "GET /oauth/callback" --failing-test "expired state returns 401" --test-file tests/oauth.test.ts --impl-files src/oauth.ts
82
- scale artifact render --task-id 2026-05-18-oauth-hardening --artifact-dir .planning/tasks/2026-05-18-oauth-hardening
83
- scale artifact doctor --artifact-dir .planning/tasks/2026-05-18-oauth-hardening
84
- ```
85
-
86
- Read [Quickstart](docs/start/quickstart.md) and [Agent Governance Demo](docs/start/agent-governance-demo.md) for the complete walkthrough.
87
-
88
- ## Who It Is For
89
-
90
- - Teams using Codex, Claude Code, Cursor, Gemini CLI, OpenCode, Aider, or similar agents on real projects.
91
- - Teams with multi-service, multi-repository, MOE workspace, frontend/backend, or scaffold governance needs.
92
- - Teams that want agents to actively use skills, MCPs, CLIs, browser automation, E2E checks, and HTML reports with safety boundaries.
93
- - Project owners who feel AI code is fast but hard to review, verify, and maintain.
94
-
95
- It is not optimized for toy projects that only want one minimal prompt file and do not need gates, collaboration rules, or long-term maintainability.
96
-
97
- ## Core Capabilities
98
-
99
- - Workflow Engine: `define -> plan -> build -> verify -> review -> ship` with persisted state.
100
- - GateSystem: build, lint, test, coverage, security, TDD, review, and tool evidence gates.
101
- - Governance Packs: `standard`, `project-scaffold`, `moe-workspace`, `resource-governance`, `go-service-matrix`, `node-library`, and `frontend-app`.
102
- - Resource Governance: docs, media, reports, test scripts, temporary scripts, HTML artifacts, and local config lifecycle rules.
103
- - Skill and Tool Orchestration: UI/UX, web research, browser E2E, Chrome DevTools MCP, desktop automation, and external agent CLIs.
104
- - Engineering Standards: noisy logs, sensitive data, injection risks, ORM/database usage, framework boundaries, test rigor, and deployment risk.
105
- - HTML Artifacts: Markdown remains the maintained source; HTML becomes the review, comparison, status, and release handoff layer.
106
-
107
- ## Installation
108
-
109
- ```bash
110
- npm install -g @hongmaple0820/scale-engine
111
- scale --version
112
- ```
113
-
114
- Node.js 20 or newer is required.
115
-
116
- ## Governance Packs
117
-
118
- Use `scale init` to install a governed workflow into an existing project:
119
-
120
- ```bash
121
- scale init --governance-pack standard
122
- scale init --governance-pack project-scaffold
123
- scale init --governance-pack moe-workspace
124
- scale init --governance-pack resource-governance
125
- scale init --governance-pack go-service-matrix
126
- scale init --governance-pack node-library
127
- scale init --governance-pack frontend-app
128
- ```
129
-
130
- Supported packs:
131
-
132
- | Pack | Best fit |
133
- | --- | --- |
134
- | `standard` | General project governance with task artifacts, verification, metrics, resources, standards, and skills policy |
135
- | `project-scaffold` | Reproducible engineering workflow scaffold and demo governance project |
136
- | `moe-workspace` | Parent workspace with independent child repositories or MOE-style multi-repo development |
137
- | `resource-governance` | Asset/document lifecycle policy for docs, reports, screenshots, scripts, media, and generated outputs |
138
- | `go-service-matrix` | Go backend services with service-aware build/lint/test/security verification |
139
- | `node-library` | Node/TypeScript package workflow, release, and verification governance |
140
- | `frontend-app` | UI/UX, browser evidence, responsive checks, E2E, and visual review governance |
141
-
142
- If you are unsure, start with `standard`. Use a specialized pack when the project shape is clear:
143
-
144
- See [Getting Started](docs/start/README.md) for runnable tutorials and demo paths.
145
-
146
- ## Phase Workflow
147
-
148
- ```bash
149
- scale define "Scoped release workflow" \
150
- --description "Implement a TypeScript CLI workflow with verification evidence, review records, rollback constraints, and release safety checks." \
151
- --success-criteria "verify evidence is persisted,review evidence is persisted,ship blocks unreviewed files"
152
-
153
- scale plan <spec-id> --rollback "Revert the release commit and remove generated artifacts"
154
- scale build <plan-id> --description "Implement scoped release workflow"
155
- scale verify <task-id>
156
- scale review <task-id>
157
- scale ship <task-id> --message "feat(workflow): add scoped release workflow"
158
- ```
159
-
160
- Use `scale ship <task-id> --no-commit` to generate the delivery report without creating a Git commit.
161
-
162
- Strict TDD evidence can be enforced when needed:
163
-
164
- ```bash
165
- scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
166
- ```
167
-
168
- The TDD evidence JSON must include `red`, `green`, `refactor`, and `testFirst` set to `true`.
169
-
170
- ## Evolution Self-Improve Loop
171
-
172
- Extract lessons from session defects and promote to rules and hooks:
173
-
174
- ```bash
175
- # Extract Lessons from session
176
- scale evolution extract <session-id>
177
-
178
- # Run self-improve loop: Defect Lesson Rule Hook
179
- scale evolution improve <session-id>
180
-
181
- # Show self-improve report
182
- scale evolution report <session-id>
183
-
184
- # View generated Hooks config
185
- scale evolution hooks <session-id> --json
186
- ```
187
-
188
- Thresholds:
189
- - Lesson Rule: requires 3 verifications
190
- - Rule → Active: requires 10 hits
191
- - Rule Hook: requires 20 hits
192
-
193
- ## Safety Model
194
-
195
- SCALE Engine uses multiple enforcement layers:
196
-
197
- | Layer | Purpose |
198
- | --- | --- |
199
- | FSM | Prevents invalid artifact lifecycle transitions |
200
- | GateSystem | Runs build, lint, test, coverage, and security gates |
201
- | EvidenceStore | Persists verification evidence for audit and release gating |
202
- | ReviewStore | Persists deterministic review records |
203
- | ReviewAnalyzer | Scans diffs for high-risk code, process debt, and missing security evidence |
204
- | Detectors | Detects brute retry, premature completion, blame shifting, busy loops, and related failure modes |
205
- | Ship gate | Requires passing verification and review evidence before release |
206
-
207
- The `ship` command no longer stages the whole workspace. It stages only files covered by passing review records and blocks if new reviewable files appear after review.
208
-
209
- Git branch governance follows a GitLab Flow variant: short branches merge into `dev`, verified releases land on `master`, and production publishing is triggered by user-created `vX.Y.Z` tags on `master`. `scale ship` blocks direct governed commits on `dev`, `master`, `main`, or detached HEAD, and temporary worktree cleanup is blocked when the branch still has unpushed or unmerged commits. See [docs/GITLAB_FLOW.md](docs/GITLAB_FLOW.md).
210
-
211
- G7 `SecurityGate` includes a lightweight built-in scan for hardcoded secrets, private keys, disabled TLS verification, `eval`/`Function`, raw HTML injection, dangerous shell commands, shell execution, and empty `catch` blocks. Compatibility mode blocks CRITICAL findings; strict mode also blocks HIGH findings.
212
-
213
- ## Skill and Tool Governance
214
-
215
- Skill Radar recommends skills, MCP servers, browser automation, desktop automation, planning workflows, memory providers, and external CLIs by task intent. It returns confidence, safety level, evidence requirements, attribution metadata, and fallback behavior.
216
-
217
- Third-party skills stay review-required until source, scripts, license, attribution, and pinned revision are checked. `OthmanAdi/planning-with-files` (MIT), `rohitg00/agentmemory` (Apache-2.0), and `garrytan/gbrain` (MIT) have explicit attribution records; other external skills, MCP servers, CLIs, adapters, and discovery candidates are tracked in the [External Reference Inventory](docs/EXTERNAL_REFERENCES.md) with unknown licenses kept `review-required`. SCALE records them as governed references, optional integrations, or adapted concepts; it does not vendor upstream source code.
218
-
219
- Memory is provider-routed rather than expanded as a built-in Memory OS. Agents can use `scale memory provider status` and `scale memory provider recall` to select `agentmemory`, `gbrain`, or `scale-local` under policy; external providers are read-only by default and fall back to local evidence-backed memory.
220
-
221
- See [Skill Radar](docs/SKILL_RADAR.md), [Third-Party Skills](docs/THIRD_PARTY_SKILLS.md), and [External Reference Inventory](docs/EXTERNAL_REFERENCES.md).
222
-
223
- ## Supported Platforms
224
-
225
- SCALE Engine includes adapters for 16 agent platforms, including Claude Code, Codex CLI, OpenCode, Cursor, Gemini CLI, OpenClaw, Hermes, Trae, WorkBuddy, VS Code Copilot CLI, QCoder, DeepSeek-TUI, Aider, Windsurf, Kimi, and Doubao.
226
-
227
- It also includes 12 professional agent profiles:
228
-
229
- - frontend
230
- - backend
231
- - testing
232
- - UI design
233
- - operations
234
- - product
235
- - code review
236
- - security
237
- - database
238
- - performance
239
- - documentation
240
- - architecture
241
-
242
- ## Project Layout
243
-
244
- ```text
245
- src/api/cli.ts CLI entrypoint
246
- src/cli/phaseCommands.ts DEFINE/PLAN/BUILD/VERIFY/REVIEW/SHIP
247
- src/cli/evolutionCommands.ts L6 Evolution CLI commands
248
- src/workflow/gates/ Quality gates and persisted evidence
249
- src/workflow/ReviewAnalyzer.ts Deterministic review analysis
250
- src/workflow/ReviewStore.ts Review record persistence
251
- src/workflow/EvidenceStore.ts Gate evidence persistence
252
- src/workflow/evolution/ LessonExtractor + SelfImproveEngine
253
- src/workflow/qa/ BrowserQA + E2ETestRunner
254
- src/artifact/ Artifact store and FSM definitions
255
- src/guardrails/ Detector and gateway logic
256
- src/guardrails/OWASPDetector.ts OWASP Top 10 security detection
257
- src/capabilities/BrowserQACapability.ts Playwright MCP wrapper
258
- src/evolution/ Defect/Lesson/Rule/Hook evolution layer
259
- tests/ Vitest test suites
260
- ```
261
-
262
- ## Development
263
-
264
- ```bash
265
- npm install
266
- npm run build
267
- npx vitest run
268
- npm pack --dry-run
269
- ```
270
-
271
- Targeted workflow tests:
272
-
273
- ```bash
274
- npx vitest run tests/workflow/phaseCli.test.ts
275
- npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.test.ts tests/workflow/gateSystem.test.ts
276
- ```
277
-
278
- ## Release Notes
279
-
280
- ### v0.20.0
281
-
282
- - Added Context Budget and Progressive Governance so low-risk S tasks stay lightweight while auth, data, security, deployment, and cross-module changes escalate automatically.
283
- - Added Code Intelligence with adapter-first CodeGraph / Graphify support, explicit fallback, impact analysis, context recommendations, and exploration ROI.
284
- - Added Workflow Eval, Failure Replay, and improvement candidates with pass@k, fix iterations, tool-call counts, token estimates, and human-correction metrics.
285
- - Added Skill Radar for intent-based skills, MCP, browser, desktop automation, and external CLI recommendations with confidence, safety level, and evidence requirements.
286
- - Added Memory Brain for evidence-backed long-term memory candidates, contradiction detection, dream maintenance, explicit promotion, and failure replay ingestion.
287
- - Added Governance Dashboard to summarize runtime, eval, memory, resource, and HTML artifact evidence in a local HTML review surface.
288
- - Fixed new `--dir` aware commands so relative `.scale` state resolves inside the target project instead of the caller workspace.
289
-
290
- ### v0.19.0
291
-
292
- - Added product smoke gates, runtime evidence learning settlement, memory context packs, workspace conflict blockers, and release-readiness demo coverage.
293
-
294
- ### v0.18.0
295
-
296
- - Governed HTML artifacts: `scale artifact render/doctor/settle/open`.
297
- - Markdown remains the editable source of truth; generated HTML is traceable task evidence.
298
- - Governance packs now include output policy and HTML artifact resource classification.
299
- - Added tests for HTML artifact rendering, safety checks, settlement evidence, and generated template output.
300
-
301
- ### v0.17.0
302
-
303
- - Added active workflow command gates: `scale context`, `scale diagnose`, `scale tdd`, and `scale status`.
304
- - Added required next-action queues so agents cannot silently skip context, debugging, TDD, or verification work.
305
-
306
- ### v0.16.0
307
-
308
- - Added governed skill repository, skill recommendation, install-safety checks, visual Vibe templates, and leadership presets.
309
- - Strengthened tool orchestration and resource/engineering standards governance.
310
-
311
- ### v0.15.1
312
-
313
- - Added UI/UX, web research, browser automation, desktop automation, and external Agent CLI routing contracts.
314
- - Added resource governance and engineering standards governance for generated project packs.
315
-
316
- ### v0.11.1
317
-
318
- - Phase Commands FSM blocking: `canTransition` + `process.exit(1)` for guard failures
319
- - OWASP Top 10 Detector: 19 security detection patterns
320
- - Browser QA Capability: Playwright MCP wrapper for E2E testing
321
- - L6 Evolution: `Defect Lesson Rule Hook` self-improve loop
322
- - Evolution CLI: `scale evolution extract/improve/report/hooks`
323
- - ReviewAnalyzer regex fix: avoid false positives on pattern definitions
324
- - Vitest suite covered in release verification
325
-
326
- ### v0.10.1
327
-
328
- - Hardened `ship` so release commits stage only files covered by passing review records.
329
- - Added `ship --no-commit` delivery reports for reviewable output without creating a Git commit.
330
- - Added optional strict TDD evidence verification with `--tdd-evidence` and `--tdd-strict`.
331
- - Added richer command evidence metadata: working directory, timestamps, stdout/stderr tails, and output hashes.
332
- - Hardened deterministic review scanning for empty `catch`, `@ts-ignore`, focused tests, dangerous shell/Git commands, and security-sensitive changes without G7 evidence.
333
- - Hardened built-in G7 security scanning with explainable file/line evidence and compatibility vs strict blocking modes.
334
- - Added CLI/unit regression tests for `review -> ship`, unreviewed-file blocking, and security-scanner false-positive boundaries.
335
- - Verified `npm run build`, full Vitest suite, and `npm pack --dry-run` before release.
336
-
337
- ### v0.10.0
338
-
339
- - Added phase-aligned workflow commands with FSM integration.
340
- - Added persisted verification evidence and review records.
341
- - Published `@hongmaple0820/scale-engine@0.10.0`.
342
- - Verified `npm run build`, full Vitest suite, and `npm pack --dry-run` before release.
343
-
344
- ## License
345
-
346
- MIT
1
+ <p align="center">
2
+ <img src="https://img.shields.io/badge/version-0.27.0-orange?style=flat-square" alt="version" />
3
+ <img src="https://img.shields.io/badge/platforms-22-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-verified-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.27.0-cb3837?style=flat-square&logo=npm" alt="npm" />
9
+ </p>
10
+
11
+ # SCALE Engine v0.27.0
12
+
13
+ SCALE Engine makes AI coding agents follow engineering rules through executable workflow gates, evidence files, and review constraints instead of relying on prompt discipline alone. It helps humans see what the agent explored, planned, verified, skipped, and why a task is or is not ready to ship.
14
+
15
+ Repository: https://github.com/hongmaple0820/scale-engine
16
+ Mirror: https://gitee.com/hongmaple/scale-engine
17
+ npm: https://www.npmjs.com/package/@hongmaple0820/scale-engine
18
+ Language: [English](README.en.md) | [Chinese](README.md)
19
+
20
+ ## 0.27.0 AI OS Runtime
21
+
22
+ 0.27.0 turns the AI Engineering OS direction into one executable entry point: `scale ai-os plan`. It creates a unified task plan with progressive governance mode, Context Compiler budget output, Memory Provider recall, Skill Routing execution steps, and Governance ROI. An agent can see which context to load, which capabilities to use, what evidence is required, and which risks escalate gates before it starts the task.
23
+
24
+ ```bash
25
+ scale ai-os plan \
26
+ --task-id TASK-123 \
27
+ --task "Fix OAuth callback auth token handling and verify browser callback flow" \
28
+ --level L \
29
+ --files src/auth/oauth.ts,src/ui/callback.tsx \
30
+ --budget 8000 \
31
+ --json
32
+ ```
33
+
34
+ This is not a claim that SCALE replaces human judgment. It is the first testable, explainable, and measurable runtime planning layer for the AI Engineering OS direction.
35
+
36
+ ## Community
37
+
38
+ SCALE Engine is an engineering workflow governance project for real AI-agent delivery. Contributions, issues, PRs, governance-pack ideas, and field reports are welcome through the source repositories. Chinese users can also follow the WeChat public account for updates, examples, and community entry points.
39
+
40
+ | Platform | Link | Purpose |
41
+ | --- | --- | --- |
42
+ | GitHub | [https://github.com/hongmaple0820/scale-engine](https://github.com/hongmaple0820/scale-engine) | Source, issues, and PRs |
43
+ | Gitee | [https://gitee.com/hongmaple/scale-engine](https://gitee.com/hongmaple/scale-engine) | China mirror and feedback |
44
+ | npm | [https://www.npmjs.com/package/@hongmaple0820/scale-engine](https://www.npmjs.com/package/@hongmaple0820/scale-engine) | CLI package |
45
+
46
+ <p align="center">
47
+ <img src="image/wechat-public.jpg" alt="SCALE Engine WeChat public account" width="220" />
48
+ </p>
49
+
50
+ ## Sponsorship
51
+
52
+ If SCALE Engine saves engineering governance time for your team, or helps move AI-agent work into a verifiable, reviewable, and releasable loop, voluntary sponsorship is welcome. Sponsorship supports maintenance, examples, documentation, test coverage, and community support. It is not a commercial support contract and does not change issue or PR priority.
53
+
54
+ <p align="center">
55
+ <img src="image/wxPay.jpg" alt="Sponsor with WeChat Pay" width="220" />
56
+ &nbsp;&nbsp;
57
+ <img src="image/zfb.jpg" alt="Sponsor with Alipay" width="220" />
58
+ </p>
59
+
60
+ ## What It Solves
61
+
62
+ AI coding becomes hard when agents must behave consistently across real teams and real repositories:
63
+
64
+ | Failure mode | SCALE mechanism |
65
+ | --- | --- |
66
+ | Agent says tests passed without running them | Verification profiles and evidence stores record actual commands and results |
67
+ | Agent skips discovery, design, TDD, or review | `scale context`, `scale diagnose`, `scale tdd`, and `scale status` produce required next actions |
68
+ | Agent stages unrelated files or edits the wrong repository | Review-gated shipping, MOE workspace rules, and child repository blockers control boundaries |
69
+ | Docs, screenshots, reports, scripts, and temporary files become unmaintainable | Resource governance classifies maintained assets, task evidence, temporary outputs, and forbidden commits |
70
+ | Noisy logs, secrets, ORM misuse, framework violations, or security risks slip through | Engineering standards and OWASP scans produce traceable findings |
71
+ | Long Markdown reports are not read | `scale artifact` renders traceable HTML reports from maintained Markdown sources |
72
+
73
+ ## See It In 3 Minutes
74
+
75
+ ```bash
76
+ npm install -g @hongmaple0820/scale-engine
77
+ mkdir scale-demo && cd scale-demo
78
+ scale init --governance-pack standard
79
+ scale preflight --preflight-profile quick
80
+ scale status
81
+ ```
82
+
83
+ This generates governance files you can commit to a project:
84
+
85
+ - `.scale/verification.json`: service matrix and verification profiles
86
+ - `.scale/skills.json`: skill routing and evidence requirements
87
+ - `.scale/tools.json`: CLI/MCP/browser/desktop orchestration policy
88
+ - `docs/workflow/templates/`: Mini-PRD, plan, verification, review, and summary templates
89
+ - `docs/standards/`: engineering, Git collaboration, and resource governance rules
90
+
91
+ Continue with a full workflow loop:
92
+
93
+ ```bash
94
+ scale context init --name "Scale Demo"
95
+ scale context grill --task-id 2026-05-18-oauth-hardening --task "Harden OAuth callback"
96
+ scale diagnose plan --task-id 2026-05-18-oauth-hardening --symptom "callback returns 500 when state expires"
97
+ scale tdd slice --task-id 2026-05-18-oauth-hardening --behavior "reject expired OAuth state" --public-interface "GET /oauth/callback" --failing-test "expired state returns 401" --test-file tests/oauth.test.ts --impl-files src/oauth.ts
98
+ scale artifact render --task-id 2026-05-18-oauth-hardening --artifact-dir .planning/tasks/2026-05-18-oauth-hardening
99
+ scale artifact doctor --artifact-dir .planning/tasks/2026-05-18-oauth-hardening
100
+ ```
101
+
102
+ Read [Quickstart](docs/start/quickstart.md) and [Agent Governance Demo](docs/start/agent-governance-demo.md) for the complete walkthrough.
103
+
104
+ ## Who It Is For
105
+
106
+ - Teams using Codex, Claude Code, Cursor, Gemini CLI, OpenCode, Aider, or similar agents on real projects.
107
+ - Teams with multi-service, multi-repository, MOE workspace, frontend/backend, or scaffold governance needs.
108
+ - Teams that want agents to actively use skills, MCPs, CLIs, browser automation, E2E checks, and HTML reports with safety boundaries.
109
+ - Project owners who feel AI code is fast but hard to review, verify, and maintain.
110
+
111
+ It is not optimized for toy projects that only want one minimal prompt file and do not need gates, collaboration rules, or long-term maintainability.
112
+
113
+ ## Core Capabilities
114
+
115
+ - Workflow Engine: `define -> plan -> build -> verify -> review -> ship` with persisted state.
116
+ - GateSystem: build, lint, test, coverage, security, TDD, review, and tool evidence gates.
117
+ - Governance Packs: `standard`, `project-scaffold`, `moe-workspace`, `resource-governance`, `go-service-matrix`, `node-library`, and `frontend-app`.
118
+ - Resource Governance: docs, media, reports, test scripts, temporary scripts, HTML artifacts, and local config lifecycle rules.
119
+ - Skill and Tool Orchestration: UI/UX, web research, browser E2E, Chrome DevTools MCP, desktop automation, and external agent CLIs.
120
+ - Engineering Standards: noisy logs, sensitive data, injection risks, ORM/database usage, framework boundaries, test rigor, and deployment risk.
121
+ - HTML Artifacts: Markdown remains the maintained source; HTML becomes the review, comparison, status, and release handoff layer.
122
+
123
+ ## Installation
124
+
125
+ ```bash
126
+ npm install -g @hongmaple0820/scale-engine
127
+ scale --version
128
+ ```
129
+
130
+ Node.js 20 or newer is required.
131
+
132
+ ## Governance Packs
133
+
134
+ Use `scale init` to install a governed workflow into an existing project:
135
+
136
+ ```bash
137
+ scale init --governance-pack standard
138
+ scale init --governance-pack project-scaffold
139
+ scale init --governance-pack moe-workspace
140
+ scale init --governance-pack resource-governance
141
+ scale init --governance-pack go-service-matrix
142
+ scale init --governance-pack node-library
143
+ scale init --governance-pack frontend-app
144
+ ```
145
+
146
+ Supported packs:
147
+
148
+ | Pack | Best fit |
149
+ | --- | --- |
150
+ | `standard` | General project governance with task artifacts, verification, metrics, resources, standards, and skills policy |
151
+ | `project-scaffold` | Reproducible engineering workflow scaffold and demo governance project |
152
+ | `moe-workspace` | Parent workspace with independent child repositories or MOE-style multi-repo development |
153
+ | `resource-governance` | Asset/document lifecycle policy for docs, reports, screenshots, scripts, media, and generated outputs |
154
+ | `go-service-matrix` | Go backend services with service-aware build/lint/test/security verification |
155
+ | `node-library` | Node/TypeScript package workflow, release, and verification governance |
156
+ | `frontend-app` | UI/UX, browser evidence, responsive checks, E2E, and visual review governance |
157
+
158
+ If you are unsure, start with `standard`. Use a specialized pack when the project shape is clear:
159
+
160
+ See [Getting Started](docs/start/README.md) for runnable tutorials and demo paths.
161
+
162
+ ## Workflow Upgrade
163
+
164
+ Do not rerun `scale init` as a blind upgrade command in existing projects. Use the guarded upgrade flow:
165
+
166
+ ```bash
167
+ scale upgrade check --dir . --lang en
168
+ scale upgrade plan --dir . --html --lang en
169
+ scale upgrade apply --dir . --confirm --lang en
170
+ scale upgrade rollback --dir . --lang en
171
+ ```
172
+
173
+ Chinese output is the default. Add `--lang en` for English prompts and English HTML plans.
174
+
175
+ Upgrade rules:
176
+
177
+ - Missing managed files can be restored automatically after plan review.
178
+ - Clean managed files whose content still matches `.scale/governance.lock.json` can be refreshed when a governance pack version changes.
179
+ - Locally edited managed files are marked `manual-review` and are not overwritten automatically.
180
+ - Third-party skills, MCP servers, desktop automation, browser tools, and external CLIs are check-only; SCALE reports source and trust policy but does not auto-install them.
181
+
182
+ See [Workflow Upgrade Guide](docs/start/workflow-upgrade.md) for the runnable path.
183
+
184
+ ## Phase Workflow
185
+
186
+ ```bash
187
+ scale define "Scoped release workflow" \
188
+ --description "Implement a TypeScript CLI workflow with verification evidence, review records, rollback constraints, and release safety checks." \
189
+ --success-criteria "verify evidence is persisted,review evidence is persisted,ship blocks unreviewed files"
190
+
191
+ scale plan <spec-id> --rollback "Revert the release commit and remove generated artifacts"
192
+ scale build <plan-id> --description "Implement scoped release workflow"
193
+ scale verify <task-id>
194
+ scale review <task-id>
195
+ scale ship <task-id> --message "feat(workflow): add scoped release workflow"
196
+ ```
197
+
198
+ Use `scale ship <task-id> --no-commit` to generate the delivery report without creating a Git commit.
199
+
200
+ Strict TDD evidence can be enforced when needed:
201
+
202
+ ```bash
203
+ scale verify <task-id> --tdd-strict --tdd-evidence .scale/tdd/<task-id>.json
204
+ ```
205
+
206
+ The TDD evidence JSON must include `red`, `green`, `refactor`, and `testFirst` set to `true`.
207
+
208
+ ## Evolution Self-Improve Loop
209
+
210
+ Extract lessons from session defects and promote to rules and hooks:
211
+
212
+ ```bash
213
+ # Extract Lessons from session
214
+ scale evolution extract <session-id>
215
+
216
+ # Run self-improve loop: Defect → Lesson → Rule → Hook
217
+ scale evolution improve <session-id>
218
+
219
+ # Show self-improve report
220
+ scale evolution report <session-id>
221
+
222
+ # View generated Hooks config
223
+ scale evolution hooks <session-id> --json
224
+ ```
225
+
226
+ Thresholds:
227
+ - Lesson Rule: requires 3 verifications
228
+ - Rule → Active: requires 10 hits
229
+ - Rule → Hook: requires 20 hits
230
+
231
+ ## Safety Model
232
+
233
+ SCALE Engine uses multiple enforcement layers:
234
+
235
+ | Layer | Purpose |
236
+ | --- | --- |
237
+ | FSM | Prevents invalid artifact lifecycle transitions |
238
+ | GateSystem | Runs build, lint, test, coverage, and security gates |
239
+ | EvidenceStore | Persists verification evidence for audit and release gating |
240
+ | ReviewStore | Persists deterministic review records |
241
+ | ReviewAnalyzer | Scans diffs for high-risk code, process debt, and missing security evidence |
242
+ | Detectors | Detects brute retry, premature completion, blame shifting, busy loops, and related failure modes |
243
+ | Ship gate | Requires passing verification and review evidence before release |
244
+
245
+ The `ship` command no longer stages the whole workspace. It stages only files covered by passing review records and blocks if new reviewable files appear after review.
246
+
247
+ Git branch governance follows a GitLab Flow variant: short branches merge into `dev`, verified releases land on `master`, and production publishing is triggered by user-created `vX.Y.Z` tags on `master`. `scale ship` blocks direct governed commits on `dev`, `master`, `main`, or detached HEAD, and temporary worktree cleanup is blocked when the branch still has unpushed or unmerged commits. See [docs/GITLAB_FLOW.md](docs/GITLAB_FLOW.md).
248
+
249
+ G7 `SecurityGate` includes a lightweight built-in scan for hardcoded secrets, private keys, disabled TLS verification, `eval`/`Function`, raw HTML injection, dangerous shell commands, shell execution, and empty `catch` blocks. Compatibility mode blocks CRITICAL findings; strict mode also blocks HIGH findings.
250
+
251
+ ## Skill and Tool Governance
252
+
253
+ Skill Radar recommends skills, MCP servers, browser automation, desktop automation, planning workflows, memory providers, and external CLIs by task intent. It returns confidence, safety level, evidence requirements, attribution metadata, and fallback behavior.
254
+
255
+ Third-party skills stay review-required until source, scripts, license, attribution, and pinned revision are checked. `OthmanAdi/planning-with-files` (MIT), `rohitg00/agentmemory` (Apache-2.0), and `garrytan/gbrain` (MIT) have explicit attribution records; other external skills, MCP servers, CLIs, adapters, and discovery candidates are tracked in the [External Reference Inventory](docs/EXTERNAL_REFERENCES.md) with unknown licenses kept `review-required`. SCALE records them as governed references, optional integrations, or adapted concepts; it does not vendor upstream source code.
256
+
257
+ Memory is provider-routed rather than expanded as a built-in Memory OS. Agents can use `scale memory provider status` and `scale memory provider recall` to select `agentmemory`, `gbrain`, or `scale-local` under policy; external providers are read-only by default and fall back to local evidence-backed memory.
258
+
259
+ See [Skill Radar](docs/SKILL_RADAR.md), [Third-Party Skills](docs/THIRD_PARTY_SKILLS.md), and [External Reference Inventory](docs/EXTERNAL_REFERENCES.md).
260
+
261
+ ## Supported Platforms
262
+
263
+ SCALE Engine includes adapters for 22 agent platforms, including Claude Code, Codex CLI, OpenCode, Cursor, Gemini CLI, OpenClaw, Hermes, Trae, WorkBuddy, VS Code Copilot CLI, QCoder, Qoder, JCode, DeepSeek-TUI, Aider, Windsurf, Kiro, Cline, Kilo Code, Antigravity, Kimi, and Doubao.
264
+
265
+ It also includes 12 professional agent profiles:
266
+
267
+ - frontend
268
+ - backend
269
+ - testing
270
+ - UI design
271
+ - operations
272
+ - product
273
+ - code review
274
+ - security
275
+ - database
276
+ - performance
277
+ - documentation
278
+ - architecture
279
+
280
+ ## Project Layout
281
+
282
+ ```text
283
+ src/api/cli.ts CLI entrypoint
284
+ src/cli/phaseCommands.ts DEFINE/PLAN/BUILD/VERIFY/REVIEW/SHIP
285
+ src/cli/evolutionCommands.ts L6 Evolution CLI commands
286
+ src/workflow/gates/ Quality gates and persisted evidence
287
+ src/workflow/ReviewAnalyzer.ts Deterministic review analysis
288
+ src/workflow/ReviewStore.ts Review record persistence
289
+ src/workflow/EvidenceStore.ts Gate evidence persistence
290
+ src/workflow/evolution/ LessonExtractor + SelfImproveEngine
291
+ src/workflow/qa/ BrowserQA + E2ETestRunner
292
+ src/artifact/ Artifact store and FSM definitions
293
+ src/guardrails/ Detector and gateway logic
294
+ src/guardrails/OWASPDetector.ts OWASP Top 10 security detection
295
+ src/capabilities/BrowserQACapability.ts Playwright MCP wrapper
296
+ src/evolution/ Defect/Lesson/Rule/Hook evolution layer
297
+ tests/ Vitest test suites
298
+ ```
299
+
300
+ ## Development
301
+
302
+ ```bash
303
+ npm install
304
+ npm run build
305
+ npx vitest run
306
+ npm pack --dry-run
307
+ ```
308
+
309
+ Targeted workflow tests:
310
+
311
+ ```bash
312
+ npx vitest run tests/workflow/phaseCli.test.ts
313
+ npx vitest run tests/workflow/reviewAnalyzer.test.ts tests/workflow/reviewStore.test.ts tests/workflow/gateSystem.test.ts
314
+ ```
315
+
316
+ ## Release Notes
317
+
318
+ ### v0.20.0
319
+
320
+ - Added Context Budget and Progressive Governance so low-risk S tasks stay lightweight while auth, data, security, deployment, and cross-module changes escalate automatically.
321
+ - Added Code Intelligence with adapter-first CodeGraph / Graphify support, explicit fallback, impact analysis, context recommendations, and exploration ROI.
322
+ - Added Workflow Eval, Failure Replay, and improvement candidates with pass@k, fix iterations, tool-call counts, token estimates, and human-correction metrics.
323
+ - Added Skill Radar for intent-based skills, MCP, browser, desktop automation, and external CLI recommendations with confidence, safety level, and evidence requirements.
324
+ - Added Memory Brain for evidence-backed long-term memory candidates, contradiction detection, dream maintenance, explicit promotion, and failure replay ingestion.
325
+ - Added Governance Dashboard to summarize runtime, eval, memory, resource, and HTML artifact evidence in a local HTML review surface.
326
+ - Fixed new `--dir` aware commands so relative `.scale` state resolves inside the target project instead of the caller workspace.
327
+
328
+ ### v0.19.0
329
+
330
+ - Added product smoke gates, runtime evidence learning settlement, memory context packs, workspace conflict blockers, and release-readiness demo coverage.
331
+
332
+ ### v0.18.0
333
+
334
+ - Governed HTML artifacts: `scale artifact render/doctor/settle/open`.
335
+ - Markdown remains the editable source of truth; generated HTML is traceable task evidence.
336
+ - Governance packs now include output policy and HTML artifact resource classification.
337
+ - Added tests for HTML artifact rendering, safety checks, settlement evidence, and generated template output.
338
+
339
+ ### v0.17.0
340
+
341
+ - Added active workflow command gates: `scale context`, `scale diagnose`, `scale tdd`, and `scale status`.
342
+ - Added required next-action queues so agents cannot silently skip context, debugging, TDD, or verification work.
343
+
344
+ ### v0.16.0
345
+
346
+ - Added governed skill repository, skill recommendation, install-safety checks, visual Vibe templates, and leadership presets.
347
+ - Strengthened tool orchestration and resource/engineering standards governance.
348
+
349
+ ### v0.15.1
350
+
351
+ - Added UI/UX, web research, browser automation, desktop automation, and external Agent CLI routing contracts.
352
+ - Added resource governance and engineering standards governance for generated project packs.
353
+
354
+ ### v0.11.1
355
+
356
+ - Phase Commands FSM blocking: `canTransition` + `process.exit(1)` for guard failures
357
+ - OWASP Top 10 Detector: 19 security detection patterns
358
+ - Browser QA Capability: Playwright MCP wrapper for E2E testing
359
+ - L6 Evolution: `Defect → Lesson → Rule → Hook` self-improve loop
360
+ - Evolution CLI: `scale evolution extract/improve/report/hooks`
361
+ - ReviewAnalyzer regex fix: avoid false positives on pattern definitions
362
+ - Vitest suite covered in release verification
363
+
364
+ ### v0.10.1
365
+
366
+ - Hardened `ship` so release commits stage only files covered by passing review records.
367
+ - Added `ship --no-commit` delivery reports for reviewable output without creating a Git commit.
368
+ - Added optional strict TDD evidence verification with `--tdd-evidence` and `--tdd-strict`.
369
+ - Added richer command evidence metadata: working directory, timestamps, stdout/stderr tails, and output hashes.
370
+ - Hardened deterministic review scanning for empty `catch`, `@ts-ignore`, focused tests, dangerous shell/Git commands, and security-sensitive changes without G7 evidence.
371
+ - Hardened built-in G7 security scanning with explainable file/line evidence and compatibility vs strict blocking modes.
372
+ - Added CLI/unit regression tests for `review -> ship`, unreviewed-file blocking, and security-scanner false-positive boundaries.
373
+ - Verified `npm run build`, full Vitest suite, and `npm pack --dry-run` before release.
374
+
375
+ ### v0.10.0
376
+
377
+ - Added phase-aligned workflow commands with FSM integration.
378
+ - Added persisted verification evidence and review records.
379
+ - Published `@hongmaple0820/scale-engine@0.10.0`.
380
+ - Verified `npm run build`, full Vitest suite, and `npm pack --dry-run` before release.
381
+
382
+ ## License
383
+
384
+ MIT