@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
@@ -0,0 +1,462 @@
1
+ # SCALE Engine Strategic Positioning
2
+
3
+ > Date: 2026-05-20
4
+ > Status: strategic direction with a v0.27.0 runtime baseline
5
+ > Audience: maintainers, contributors, roadmap reviewers, and product-facing documentation owners
6
+
7
+ SCALE Engine should be positioned as an **Agent Governance Runtime** evolving toward an **AI Engineering OS**.
8
+
9
+ The project is no longer best described as a prompt toolbox. Its durable value is the runtime layer around AI coding agents:
10
+
11
+ - workflow state machines
12
+ - hard gates and verification evidence
13
+ - hook-based tool interception
14
+ - role and permission boundaries
15
+ - artifact persistence
16
+ - context budgets
17
+ - memory provider routing
18
+ - skill, MCP, CLI, and adapter orchestration
19
+
20
+ The core thesis is:
21
+
22
+ > Use system constraints, evidence, and runtime gates to replace agent self-discipline.
23
+
24
+ This positioning is intentionally stronger than "prompt engineering", but it must stay evidence-backed. SCALE can describe the direction as AI Engineering OS; it should only describe measurable gains after benchmark, eval, or runtime evidence exists.
25
+
26
+ ## Reference Inputs
27
+
28
+ This document consolidates:
29
+
30
+ - the current SCALE Engine architecture and documentation surfaces
31
+ - maintainer review of SCALE as an Agent Governance Runtime
32
+ - the external Harness Engineering framing in [SCALE OS v10.0: AI 编码的认知操作系统](https://segmentfault.com/a/1190000047756584)
33
+
34
+ External performance claims from ecosystem articles are positioning inputs, not SCALE Engine release claims. Public SCALE claims should still be backed by local evals, runtime evidence, or release reports.
35
+
36
+ ## 1. Market Category
37
+
38
+ SCALE sits between four emerging categories:
39
+
40
+ | Category | SCALE relationship |
41
+ | --- | --- |
42
+ | AI Engineering OS | Long-term positioning: one governed operating layer for agent-driven engineering |
43
+ | Agent Governance Runtime | Current strongest fit: gates, hooks, evidence, role boundaries, and policy enforcement |
44
+ | Workflow Orchestration Runtime | Current fit: FSM, phase commands, artifacts, verification, and ship flow |
45
+ | Harness Engineering Infrastructure | Methodology fit: constraints + feedback + workflow + continuous improvement |
46
+
47
+ SCALE should avoid being framed as only:
48
+
49
+ - prompt templates
50
+ - agent rules
51
+ - a Claude/Cursor/Codex config generator
52
+ - an AutoGPT-style chain executor
53
+ - a generic skills catalog
54
+
55
+ Those may exist around the project, but they are not the core defensible layer.
56
+
57
+ ## 2. Problem Definition
58
+
59
+ AI coding failures are not only model-quality failures. They are engineering runtime failures:
60
+
61
+ | Failure mode | Typical prompt-only response | SCALE response |
62
+ | --- | --- | --- |
63
+ | Fake completion | "Please verify before finishing" | verification gates and final evidence checks |
64
+ | Skipped tests | reminder text | FSM and verification status before completion |
65
+ | Repeated blind retries | "try a different approach" | retry and behavior detectors |
66
+ | Context overload | longer instructions | context budgets, lazy loading, scoped packs |
67
+ | Agent drift | more rules | persisted workflow state and phase boundaries |
68
+ | Hallucinated delivery | review prompt | runtime evidence ledger and ship gates |
69
+ | Lost learning | chat history | memory artifacts, failure replay, lessons, rule candidates |
70
+ | Multi-agent confusion | role descriptions | role gateway and tool permission boundaries |
71
+ | Tool overreach | trust agent judgment | hook interception and policy gateway |
72
+
73
+ The strategic target is not to make the model "more obedient". The target is to make non-compliant behavior observable, blockable, and recoverable.
74
+
75
+ ## 3. Current Strengths
76
+
77
+ ### 3.1 Runtime Constraints
78
+
79
+ SCALE already has the right architectural instinct: lower critical rules from prompt text into runtime checks.
80
+
81
+ Relevant surfaces:
82
+
83
+ - `docs/ENGINEERING_STANDARDS.md`
84
+ - `docs/RUNTIME_EVIDENCE.md`
85
+ - `docs/DEPENDENCY_AUDIT.md`
86
+ - `src/workflow/gates/GateSystem.ts`
87
+ - `src/guardrails/Gateway.ts`
88
+ - `src/artifact/fsm.ts`
89
+
90
+ This is the primary moat. Prompt rules can be ignored; runtime gates can block progress.
91
+
92
+ ### 3.2 Workflow State Machine
93
+
94
+ The workflow is driven by artifact state, not by chat momentum.
95
+
96
+ Strategic value:
97
+
98
+ - prevents premature completion
99
+ - forces phase-specific evidence
100
+ - makes stalled or skipped phases visible
101
+ - supports resume and handoff across long sessions
102
+ - gives agent platforms a shared lifecycle model
103
+
104
+ The FSM should remain strict at phase boundaries and flexible inside each phase.
105
+
106
+ ### 3.3 Hook and Gateway Layer
107
+
108
+ Hooks, pre-tool checks, post-tool checks, stop checks, and role-aware gateway decisions form the AI runtime interceptor layer.
109
+
110
+ Strategic value:
111
+
112
+ - agents do not receive raw, unlimited tool authority
113
+ - unsafe operations can be blocked before execution
114
+ - tool output can be converted into evidence
115
+ - repeated failure patterns can be detected outside the model
116
+
117
+ This layer makes SCALE closer to an admission controller than a prompt pack.
118
+
119
+ ### 3.4 Evidence-Backed Delivery
120
+
121
+ SCALE's strongest anti-hallucination capability is engineering hallucination control:
122
+
123
+ - no test evidence means no verified claim
124
+ - no runtime evidence means no product-smoke claim
125
+ - no reviewed file scope means no governed ship
126
+ - no dependency audit evidence means weaker security confidence
127
+
128
+ This reduces fake completion more reliably than instruction text.
129
+
130
+ It does not fully solve reasoning hallucination. Architecture decisions, root-cause analysis, and technical tradeoffs still need evaluator intelligence.
131
+
132
+ ### 3.5 Adapter and Platform Surface
133
+
134
+ The agent-platform adapters let SCALE act as a shared governance layer for different coding agents.
135
+
136
+ Strategic value:
137
+
138
+ - one governance model across Claude Code, Codex, Cursor, Gemini, Windsurf, Kiro, Cline, and related tools
139
+ - fewer duplicated rule files
140
+ - lower switching cost between agents
141
+ - consistent evidence and workflow semantics
142
+
143
+ Adapter expansion should not become the main roadmap by itself. The strategic value comes from shared governance semantics, not from the count of supported agents.
144
+
145
+ ## 4. Honest Capability Assessment
146
+
147
+ SCALE can already claim:
148
+
149
+ - stronger engineering governance than prompt-only rules
150
+ - structured workflow execution with phase and artifact state
151
+ - hard verification gates for delivery claims
152
+ - evidence-based runtime reporting
153
+ - first-class supply-chain audit direction
154
+ - growing adapter coverage
155
+ - memory and skill orchestration foundations
156
+
157
+ SCALE should not yet overclaim:
158
+
159
+ - fully autonomous self-evolution
160
+ - human-level long-term memory
161
+ - guaranteed token reduction percentages
162
+ - guaranteed hallucination reduction percentages
163
+ - adaptive cognitive planning
164
+ - universal skill routing intelligence
165
+
166
+ Use target ranges only in roadmap or evaluation documents, not as product claims, until eval evidence supports them.
167
+
168
+ ## 5. Current Gaps
169
+
170
+ ### 5.1 Memory Architecture
171
+
172
+ Current state is closer to engineering knowledge persistence than true cognitive memory.
173
+
174
+ Existing strengths:
175
+
176
+ - artifacts persist decisions and work state
177
+ - memory brain stores evidence-backed learnings
178
+ - failure replay can preserve incidents
179
+ - provider routing gives the right extension point
180
+
181
+ Missing layers:
182
+
183
+ | Memory type | Target meaning |
184
+ | --- | --- |
185
+ | Working memory | short-lived task context with strict token budget |
186
+ | Episodic memory | past task episodes, failures, fixes, and outcomes |
187
+ | Semantic memory | stable project facts and domain concepts |
188
+ | Procedural memory | reusable ways of doing work |
189
+ | Strategy memory | learned routing, verification, and recovery strategies |
190
+
191
+ The next memory work should focus on provider-backed retrieval quality, not more local file accumulation.
192
+
193
+ ### 5.2 Context Compiler
194
+
195
+ SCALE has context structure and budgets. It does not yet have a full context compiler.
196
+
197
+ Current capability:
198
+
199
+ - categorize context
200
+ - budget context
201
+ - lazy-load selected material
202
+ - assemble role/task-specific packs
203
+
204
+ Target capability:
205
+
206
+ - rank relevance
207
+ - slice semantically
208
+ - compress adaptively
209
+ - route retrieval by task intent
210
+ - explain why each context item was included
211
+ - measure token saved vs evidence lost
212
+
213
+ This is the highest-leverage path for token reduction.
214
+
215
+ ### 5.3 Adaptive Workflow
216
+
217
+ The current workflow is mostly rule-driven.
218
+
219
+ The target workflow should adapt based on:
220
+
221
+ - task risk
222
+ - code ownership boundaries
223
+ - prior failure rate
224
+ - changed-file blast radius
225
+ - missing evidence
226
+ - tool reliability
227
+ - agent capability confidence
228
+
229
+ The system should not make every task heavy. It should apply stricter gates when risk rises and keep small documentation or config changes lightweight.
230
+
231
+ ### 5.4 Skill Routing Intelligence
232
+
233
+ SCALE already models skills, MCP, CLI, browser, desktop automation, and evidence requirements.
234
+
235
+ The missing layer is strategy:
236
+
237
+ - when to call a skill
238
+ - why that skill is preferred
239
+ - what evidence it must produce
240
+ - what to do when it fails
241
+ - when to switch to MCP or CLI
242
+ - when to avoid tool use entirely
243
+
244
+ Skill routing should become a planned execution graph, not an ad hoc recommendation list.
245
+
246
+ ### 5.5 Evaluator Intelligence
247
+
248
+ Current gates are strong for engineering completion, but weaker for reasoning quality.
249
+
250
+ Needed evaluator layers:
251
+
252
+ - critique loop for architecture and root cause
253
+ - uncertainty scoring
254
+ - adversarial review on high-risk changes
255
+ - tradeoff comparison
256
+ - failure hypothesis ranking
257
+ - "evidence is insufficient" verdicts
258
+
259
+ This is the path to reducing reasoning hallucination rather than only delivery hallucination.
260
+
261
+ ### 5.6 Self-Optimization Loop
262
+
263
+ Evolution should mean more than summarizing lessons.
264
+
265
+ The target loop:
266
+
267
+ ```text
268
+ failure evidence
269
+ -> defect record
270
+ -> root-cause classification
271
+ -> lesson candidate
272
+ -> rule candidate
273
+ -> hook or gate proposal
274
+ -> shadow validation
275
+ -> regression check
276
+ -> promoted governance behavior
277
+ ```
278
+
279
+ The promotion step must remain evidence-backed. Automatically generating rules without validation risks turning mistakes into permanent friction.
280
+
281
+ ## 6. Roadmap Direction
282
+
283
+ ### 6.1 Immediate Patch: 0.26.1
284
+
285
+ Goal: publish the security patch before expanding strategic scope.
286
+
287
+ Primary outcomes:
288
+
289
+ - remove `verify-task` shell execution risk from the published package
290
+ - document safe verification command semantics
291
+ - pin and override flagged dependency versions where applicable
292
+ - preserve production dependency audit health
293
+
294
+ This is a trust-maintenance release. It should not be mixed with large roadmap changes.
295
+
296
+ ### 6.2 0.27.0: Cognitive Runtime Layer
297
+
298
+ Theme: make context, memory, and skill use more intelligent and explainable.
299
+
300
+ Core work:
301
+
302
+ | Module | Outcome |
303
+ | --- | --- |
304
+ | Context Compiler | relevance-ranked, budgeted, explainable context packs |
305
+ | Memory Provider Runtime | gbrain, agentmemory, code memory, and local memory as provider choices |
306
+ | Skill Routing Engine | task-intent routing with evidence requirements and fallback decisions |
307
+ | Governance ROI | quantify token cost, evidence quality, and gate friction |
308
+
309
+ Implemented baseline in v0.27.0:
310
+
311
+ ```bash
312
+ scale ai-os plan \
313
+ --task-id TASK-123 \
314
+ --task "Fix OAuth callback auth token handling and verify browser flow" \
315
+ --level L \
316
+ --files src/auth/oauth.ts,src/ui/callback.tsx \
317
+ --budget 8000 \
318
+ --json
319
+ ```
320
+
321
+ The command returns one runtime plan containing:
322
+
323
+ - `governance`: progressive mode, risk signals, required behaviors
324
+ - `context`: Context Compiler ranking, included sections, omitted sections, token savings
325
+ - `memory`: provider order, selected providers, fallback status, recalled items, memory context pack
326
+ - `skillPlan`: detected intents plus executable skill/artifact/verification steps
327
+ - `adaptiveWorkflow`: risk-adaptive gates and exit criteria for the task
328
+ - `roi`: benefit and overhead modules for context, memory, skill routing, and governance
329
+
330
+ Exit criteria:
331
+
332
+ - each context item has an inclusion reason: baseline implemented by `ContextCompiler`
333
+ - memory recall has provider, score, and evidence source: baseline implemented by Memory Provider Router
334
+ - skill recommendations include why, when, and required proof: baseline implemented by skill execution plans
335
+ - context pack generation reports token budget and omissions: baseline implemented by `context.pack.compiler`
336
+
337
+ ### 6.3 0.28.0: Adaptive Governance
338
+
339
+ Theme: deepen adaptive governance beyond the v0.27.0 baseline.
340
+
341
+ Core work:
342
+
343
+ | Module | Outcome |
344
+ | --- | --- |
345
+ | Adaptive Workflow Router | production policy controls for dynamic gate profiles beyond the v0.27.0 planning output |
346
+ | Evaluator Intelligence | critique and uncertainty gates for architecture/root-cause work |
347
+ | Tool Strategy Planner | cost, retry, fallback, and evidence graph for tools |
348
+ | Evolution Shadow Promotion | lessons become rules only after validation |
349
+
350
+ Exit criteria:
351
+
352
+ - small tasks can stay lightweight with evidence
353
+ - risky tasks escalate automatically
354
+ - reasoning-heavy tasks get critique/evaluator gates
355
+ - evolution proposals can be traced to failure evidence and validation results
356
+
357
+ ### 6.4 0.29.0+: Agent Engineering OS
358
+
359
+ Theme: integrate governance, memory, context, and tools into an operating layer.
360
+
361
+ Target capabilities:
362
+
363
+ - unified agent workspace policy
364
+ - provider-neutral memory and code intelligence
365
+ - cross-agent execution ledger
366
+ - adaptive workflow templates
367
+ - measurable token and quality reports
368
+ - ecosystem-safe skill and MCP lifecycle governance
369
+
370
+ ## 7. Measurement Plan
371
+
372
+ Strategic claims must be tied to measurement.
373
+
374
+ | Claim | Required metric |
375
+ | --- | --- |
376
+ | Fewer fake completions | final-check failure rate before/after gates |
377
+ | Fewer skipped steps | FSM blocked transition count and successful recovery rate |
378
+ | Fewer blind retries | repeated-command detector hits and fix iteration count |
379
+ | Lower token use | context pack token count vs baseline full-context load |
380
+ | Better memory | recall precision, accepted memory rate, contradiction count |
381
+ | Better skill use | recommended skill acceptance rate and evidence completion rate |
382
+ | Better workflow quality | pass@1, average fix iterations, failure replay closure rate |
383
+ | Safer dependencies | dependency audit block count and reviewed baseline count |
384
+
385
+ Target ranges can be tracked internally, but public claims should use measured values from `WORKFLOW_EVAL`, runtime evidence, or release reports.
386
+
387
+ ## 8. Messaging Rules
388
+
389
+ Use:
390
+
391
+ - "Agent Governance Runtime"
392
+ - "AI Engineering OS direction"
393
+ - "runtime constraints instead of prompt-only discipline"
394
+ - "evidence-backed workflow gates"
395
+ - "provider-based memory and context orchestration"
396
+
397
+ Avoid:
398
+
399
+ - "fully autonomous engineer"
400
+ - "guaranteed 90% AI coding rate"
401
+ - "eliminates hallucination"
402
+ - "zero human governance"
403
+ - "universal memory"
404
+ - "all tools are safe by default"
405
+
406
+ The product message should be ambitious, but the engineering message must stay falsifiable.
407
+
408
+ ## 9. Non-Goals
409
+
410
+ SCALE should not try to own every layer.
411
+
412
+ Non-goals:
413
+
414
+ - replacing all agent platforms
415
+ - building a full IDE
416
+ - becoming a generic automation shell
417
+ - implementing every memory backend internally
418
+ - copying external skills without attribution
419
+ - turning every task into heavyweight enterprise ceremony
420
+
421
+ The correct posture is:
422
+
423
+ > Govern agent engineering work, integrate external capability providers, and require evidence at the boundaries.
424
+
425
+ ## 10. Documentation Placement
426
+
427
+ Recommended documentation split:
428
+
429
+ | Surface | Content |
430
+ | --- | --- |
431
+ | `README.md` / `README.en.md` | concise positioning, installation, core value, current capabilities |
432
+ | `docs/AI_ENGINEERING_OS_POSITIONING.md` | strategic category, gaps, roadmap, messaging rules |
433
+ | `docs/CONTEXT_BUDGET.md` | context budget and compiler mechanics |
434
+ | `docs/MEMORY_BRAIN.md` / `docs/MEMORY_FABRIC.md` | memory provider and recall behavior |
435
+ | `docs/SKILL_RADAR.md` / `docs/TOOL_ORCHESTRATION.md` | skill and tool routing behavior |
436
+ | `docs/WORKFLOW_EVAL.md` | measurable evidence and improvement claims |
437
+
438
+ README should not absorb this whole strategy. It should link here and keep the first screen user-focused.
439
+
440
+ ## 11. Strategic Summary
441
+
442
+ SCALE's strongest current differentiator is not more prompts. It is a runtime governance model for AI engineering:
443
+
444
+ ```text
445
+ Agent intent
446
+ -> governed workflow state
447
+ -> scoped context
448
+ -> role/tool policy
449
+ -> evidence-producing execution
450
+ -> verification gates
451
+ -> memory and evolution feedback
452
+ ```
453
+
454
+ The next stage is to make this runtime more cognitive:
455
+
456
+ - compile context, do not just load it
457
+ - route memory, do not just store it
458
+ - plan skill use, do not just recommend it
459
+ - adapt workflow, do not just enforce one path
460
+ - validate evolution, do not just summarize lessons
461
+
462
+ If these are implemented with measurable evidence, SCALE can credibly move from "AI workflow engine" to "AI Engineering OS".
@@ -1,62 +1,62 @@
1
- # Background Hunter
2
-
3
- Background Hunter is the readonly proactive scan layer for SCALE Engine V2.
4
- It turns existing governance signals into an actionable hunt queue without editing application code.
5
-
6
- ## Boundary
7
-
8
- Default behavior is intentionally conservative:
9
-
10
- - scan only, no automatic code changes
11
- - no automatic LLM repair
12
- - no automatic commit or pull request
13
- - no release bypass
14
- - ignore decisions are explicit and written to `.scale/hunt/ignored-findings.json`
15
-
16
- The hunter reuses existing checks instead of creating a second rule system. The first implementation consumes:
17
-
18
- - `EngineeringStandards`
19
- - `ReviewAnalyzer` when status and diff input are provided by callers
20
-
21
- ## Commands
22
-
23
- ```bash
24
- scale hunt scan
25
- scale hunt scan --json
26
- scale hunt report
27
- scale hunt diagnose <finding-id>
28
- scale hunt ignore <finding-id> --reason "Accepted legacy debt tracked elsewhere"
29
- ```
30
-
31
- `hunt scan` and `hunt report` do not modify source files. They classify findings as `open` or `ignored`.
32
-
33
- `hunt diagnose <finding-id>` creates a normal `DiagnosticLoop` from the finding. This keeps the debugging workflow evidence-first:
34
-
35
- - reproducible command
36
- - expected failure
37
- - changed files
38
- - verification commands
39
- - hypotheses and cleanup checklist
40
-
41
- `hunt ignore` records the finding id and stable fingerprint. The same finding will remain visible in the report as `ignored`, but it is removed from the open queue.
42
-
43
- ## Finding Identity
44
-
45
- Every finding gets:
46
-
47
- - `id`: short deterministic SHA-256 id derived from the fingerprint
48
- - `fingerprint`: stable source/rule/path/line/message tuple
49
- - `source`: currently `engineering-standards` or `review-analyzer`
50
- - `diagnosticInput`: ready-to-use `DiagnosticLoopInput`
51
-
52
- This allows repeated scans to avoid noisy duplicates and lets teams explicitly accept or defer known debt.
53
-
54
- ## Recommended Flow
55
-
56
- 1. Run `scale hunt scan --json`.
57
- 2. Triage open findings.
58
- 3. For real issues, run `scale hunt diagnose <finding-id> --json`.
59
- 4. Fix through the normal plan/TDD/verify workflow.
60
- 5. For accepted legacy debt, run `scale hunt ignore <finding-id> --reason "..."`
61
-
62
- Do not promote Background Hunter to automatic repair until the project has enough evidence that its findings are stable and low-noise.
1
+ # Background Hunter
2
+
3
+ Background Hunter is the readonly proactive scan layer for SCALE Engine V2.
4
+ It turns existing governance signals into an actionable hunt queue without editing application code.
5
+
6
+ ## Boundary
7
+
8
+ Default behavior is intentionally conservative:
9
+
10
+ - scan only, no automatic code changes
11
+ - no automatic LLM repair
12
+ - no automatic commit or pull request
13
+ - no release bypass
14
+ - ignore decisions are explicit and written to `.scale/hunt/ignored-findings.json`
15
+
16
+ The hunter reuses existing checks instead of creating a second rule system. The first implementation consumes:
17
+
18
+ - `EngineeringStandards`
19
+ - `ReviewAnalyzer` when status and diff input are provided by callers
20
+
21
+ ## Commands
22
+
23
+ ```bash
24
+ scale hunt scan
25
+ scale hunt scan --json
26
+ scale hunt report
27
+ scale hunt diagnose <finding-id>
28
+ scale hunt ignore <finding-id> --reason "Accepted legacy debt tracked elsewhere"
29
+ ```
30
+
31
+ `hunt scan` and `hunt report` do not modify source files. They classify findings as `open` or `ignored`.
32
+
33
+ `hunt diagnose <finding-id>` creates a normal `DiagnosticLoop` from the finding. This keeps the debugging workflow evidence-first:
34
+
35
+ - reproducible command
36
+ - expected failure
37
+ - changed files
38
+ - verification commands
39
+ - hypotheses and cleanup checklist
40
+
41
+ `hunt ignore` records the finding id and stable fingerprint. The same finding will remain visible in the report as `ignored`, but it is removed from the open queue.
42
+
43
+ ## Finding Identity
44
+
45
+ Every finding gets:
46
+
47
+ - `id`: short deterministic SHA-256 id derived from the fingerprint
48
+ - `fingerprint`: stable source/rule/path/line/message tuple
49
+ - `source`: currently `engineering-standards` or `review-analyzer`
50
+ - `diagnosticInput`: ready-to-use `DiagnosticLoopInput`
51
+
52
+ This allows repeated scans to avoid noisy duplicates and lets teams explicitly accept or defer known debt.
53
+
54
+ ## Recommended Flow
55
+
56
+ 1. Run `scale hunt scan --json`.
57
+ 2. Triage open findings.
58
+ 3. For real issues, run `scale hunt diagnose <finding-id> --json`.
59
+ 4. Fix through the normal plan/TDD/verify workflow.
60
+ 5. For accepted legacy debt, run `scale hunt ignore <finding-id> --reason "..."`
61
+
62
+ Do not promote Background Hunter to automatic repair until the project has enough evidence that its findings are stable and low-noise.