opencode-agent-skill 13.0.0-beta.2 → 14.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1571 -607
- package/bin/ocskill.mjs +172 -24
- package/docs/OPENCODE-COMPAT.md +34 -97
- package/docs/PI-COMPAT.md +203 -0
- package/docs/V14-CONTEXT-MEMORY-FABRIC.md +70 -0
- package/docs/V14.1-QUALITY-PERFORMANCE-FABRIC.md +114 -0
- package/docs/V14.2-TURBO-WEAK-MODEL-RUNTIME.md +448 -0
- package/evals/v14/tasks.json +46 -0
- package/global-config/agents/executor.md +7 -0
- package/global-config/agents/visual-verifier.md +22 -3
- package/global-config/plugins/ues-router/index.js +13 -8
- package/global-config/plugins/ues-router/policy-runtime.js +7 -0
- package/global-config/plugins/ues-router/router.js +12 -2
- package/global-config/skills/ecommerce-engineering/SKILL.md +1 -1
- package/global-config/skills/file-upload-engineering/SKILL.md +1 -1
- package/global-config/skills/git-safety/SKILL.md +1 -1
- package/global-config/skills/nestjs-engineering/SKILL.md +1 -1
- package/global-config/skills/performance-engineering/SKILL.md +1 -1
- package/global-config/skills/react-native-engineering/SKILL.md +1 -1
- package/global-config/skills/rest-api-design/SKILL.md +1 -1
- package/global-config/skills/ui-ux-engineering/SKILL.md +1 -1
- package/lib/adaptive-context-budget.mjs +97 -0
- package/lib/affected-tests.mjs +260 -0
- package/lib/benchmark-confidence.mjs +41 -2
- package/lib/browser-mcp-routing.mjs +166 -0
- package/lib/capability-fabric.mjs +359 -0
- package/lib/capability-registry.mjs +9 -0
- package/lib/code-intelligence/edit-anchor.mjs +102 -0
- package/lib/code-intelligence/index.mjs +95 -0
- package/lib/code-intelligence/lsp-provider.mjs +189 -0
- package/lib/completion-auditor.mjs +82 -0
- package/lib/context-engine-v11.mjs +65 -1
- package/lib/context-graph-rank.mjs +118 -0
- package/lib/context-manifest.mjs +97 -18
- package/lib/control-center.mjs +19 -1
- package/lib/document-ingestion.mjs +60 -0
- package/lib/dynamic-workflow.mjs +3 -1
- package/lib/evidence-store.mjs +82 -1
- package/lib/fast-verification-gate.mjs +69 -0
- package/lib/hierarchical-context.mjs +215 -0
- package/lib/mcp-health.mjs +144 -0
- package/lib/mcp-tool-policy.mjs +19 -0
- package/lib/memory-engine.mjs +493 -0
- package/lib/model-performance.mjs +33 -8
- package/lib/model-policy.mjs +3 -3
- package/lib/orchestrator-policy.mjs +5 -209
- package/lib/performance-fabric.mjs +229 -0
- package/lib/pi-rpc-pool.mjs +433 -0
- package/lib/process-hang-detector.mjs +83 -0
- package/lib/process-supervisor.mjs +193 -0
- package/lib/prompt-cache.mjs +27 -11
- package/lib/repo-graph.mjs +53 -2
- package/lib/reversible-context.mjs +49 -0
- package/lib/runtime-config.mjs +31 -0
- package/lib/safety.mjs +132 -0
- package/lib/semantic-index.mjs +52 -3
- package/lib/skill-compiler.mjs +128 -0
- package/lib/skill-quality.mjs +48 -2
- package/lib/task-engine.mjs +62 -5
- package/lib/task-policy.mjs +291 -0
- package/lib/verification-broker.mjs +284 -0
- package/lib/verification-command.mjs +111 -0
- package/lib/windows-shim.mjs +35 -0
- package/lib/workspace-fingerprint.mjs +198 -0
- package/package.json +52 -42
- package/pi/extensions/ues-child-runtime.ts +393 -0
- package/pi/extensions/ues.ts +3327 -0
- package/pi/prompts/ues-audit.md +9 -0
- package/pi/prompts/ues-critique.md +9 -0
- package/pi/prompts/ues-debug.md +9 -0
- package/pi/prompts/ues-feature.md +9 -0
- package/pi/prompts/ues-fix.md +9 -0
- package/pi/prompts/ues-plan.md +9 -0
- package/pi/prompts/ues-research.md +9 -0
- package/pi/prompts/ues-resume.md +9 -0
- package/pi/prompts/ues-review.md +7 -0
- package/pi/prompts/ues-run.md +17 -0
- package/pi/prompts/ues-verify.md +9 -0
- package/scripts/check-release-consistency.mjs +119 -185
- package/scripts/check-runtime-exports.mjs +66 -0
- package/scripts/check-source-integrity.mjs +246 -0
- package/scripts/eval-pi.mjs +492 -0
- package/scripts/install.mjs +16 -0
- package/scripts/smoke-package-closure.mjs +110 -0
- package/scripts/smoke-packed-install.mjs +24 -11
- package/scripts/smoke-pi-extension.mjs +144 -0
- package/scripts/uninstall.mjs +44 -0
- package/CHANGELOG.md +0 -415
- package/docs/DETERMINISTIC-TOOLS.md +0 -105
- package/docs/ENGINEERING-DESIGN.md +0 -194
- package/docs/EVALS.md +0 -158
- package/docs/GITHUB-RULESET.md +0 -50
- package/docs/NPM-PUBLISH.md +0 -116
- package/docs/RESEARCH-SOURCES.md +0 -37
- package/docs/TRACE-SCHEMA.md +0 -122
- package/docs/V11-PERCEPTION-ADAPTIVE-EXECUTION.md +0 -75
- package/docs/V11-PERCEPTION-ADAPTIVE.md +0 -220
- package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +0 -27
- package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +0 -86
- package/docs/V7-INTELLIGENCE-RUNTIME.md +0 -166
- package/docs/V8-INTELLIGENCE-RELIABILITY.md +0 -206
- package/docs/V9-SPEED-INTELLIGENCE.md +0 -102
package/README.md
CHANGED
|
@@ -1,849 +1,1813 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UES for Pi Agent
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
> **Stable latest vẫn là V11: 11.0.0.** V13 được đóng gói dưới prerelease `13.0.0-beta.2`; npm prerelease dùng dist-tag `next`, còn `latest` tiếp tục giữ V11 cho đến khi V13 được promote stable.
|
|
3
|
+
> Universal Engineering System (UES) là một engineering runtime dành cho **Pi Agent**, tập trung vào việc giúp model coding nhỏ/yếu làm việc có cấu trúc hơn trên repository thật: lấy đúng context, chia task, giữ trạng thái dài hạn, cô lập thay đổi, thu evidence và chỉ kết luận khi có verification.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
**Package:** <code>opencode-agent-skill</code>
|
|
6
|
+
**Host chính:** Pi Agent
|
|
7
|
+
**Phiên bản package hiện tại:** <code>14.4.0</code>
|
|
8
|
+
**Release hiện tại:** V14.4 Stable Weak-Model Intelligence Runtime
|
|
9
|
+
**Runtime:** Node.js 22.19+
|
|
10
|
+
**License:** MIT
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
> UES không biến một model nhỏ thành model lớn theo nghĩa năng lực nền tảng. UES cố gắng giảm phần suy luận hạ tầng mà model phải tự gánh bằng deterministic tooling, bounded context, specialist roles, durable state và evidence-gated verification.
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Mục lục
|
|
17
|
+
|
|
18
|
+
1. [UES giải quyết vấn đề gì?](#ues-giải-quyết-vấn-đề-gì)
|
|
19
|
+
2. [Kiến trúc tổng thể](#kiến-trúc-tổng-thể)
|
|
20
|
+
3. [Luồng /ues-run end-to-end](#luồng-ues-run-end-to-end)
|
|
21
|
+
4. [Task Policy: FAST / STANDARD / DEEP](#task-policy-fast--standard--deep)
|
|
22
|
+
5. [12 specialist agents](#12-specialist-agents)
|
|
23
|
+
6. [48 skills](#48-skills)
|
|
24
|
+
7. [11 slash prompts](#11-slash-prompts)
|
|
25
|
+
8. [Context Engine L0/L1/L2](#context-engine-l0l1l2)
|
|
26
|
+
9. [Semantic index, repo graph và ACI](#semantic-index-repo-graph-và-aci)
|
|
27
|
+
10. [Model routing và recovery](#model-routing-và-recovery)
|
|
28
|
+
11. [Task graph, Dynamic Workflow và parallel runtime](#task-graph-dynamic-workflow-và-parallel-runtime)
|
|
29
|
+
12. [Worktree sandbox](#worktree-sandbox)
|
|
30
|
+
13. [Evidence Store, receipts và verification gates](#evidence-store-receipts-và-verification-gates)
|
|
31
|
+
14. [V14.1 reversible output compaction](#v141-reversible-output-compaction)
|
|
32
|
+
15. [V14.2 Turbo Weak-Model Runtime](#v142-turbo-weak-model-runtime)
|
|
33
|
+
16. [Verified Persistent Memory](#verified-persistent-memory)
|
|
34
|
+
17. [Capability Fabric](#capability-fabric)
|
|
35
|
+
18. [Playwright / Browser MCP on-demand](#playwright--browser-mcp-on-demand)
|
|
36
|
+
19. [Trajectory và observability](#trajectory-và-observability)
|
|
37
|
+
20. [Learning engine và benchmark confidence](#learning-engine-và-benchmark-confidence)
|
|
38
|
+
21. [Durable long-horizon work](#durable-long-horizon-work)
|
|
39
|
+
22. [Control Center](#control-center)
|
|
40
|
+
23. [Safety model](#safety-model)
|
|
41
|
+
24. [Cài đặt](#cài-đặt)
|
|
42
|
+
25. [Cập nhật](#cập-nhật)
|
|
43
|
+
26. [Đóng gói npm](#đóng-gói-npm)
|
|
44
|
+
27. [Các CLI quan trọng](#các-cli-quan-trọng)
|
|
45
|
+
28. [Benchmark model yếu](#benchmark-model-yếu)
|
|
46
|
+
29. [Cấu trúc repository](#cấu-trúc-repository)
|
|
47
|
+
30. [Triết lý thiết kế](#triết-lý-thiết-kế)
|
|
48
|
+
31. [Giới hạn có chủ đích](#giới-hạn-có-chủ-đích)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
# UES giải quyết vấn đề gì?
|
|
12
53
|
|
|
13
|
-
|
|
14
|
-
- chia tác vụ lớn thành các bước rõ ràng;
|
|
15
|
-
- lưu trạng thái ra filesystem để có thể tiếp tục sau khi session bị ngắt;
|
|
16
|
-
- chạy executor bằng context mới cho từng tác vụ;
|
|
17
|
-
- yêu cầu bằng chứng kiểm thử trước khi đánh dấu hoàn tất;
|
|
18
|
-
- kiểm tra thay đổi ở mức task và mức tích hợp toàn hệ thống;
|
|
19
|
-
- hỗ trợ routing skill, model tier, task policy và recovery theo trạng thái thực tế của repository.
|
|
54
|
+
Một coding model yếu thường gặp các vấn đề sau khi làm việc trên repository thật:
|
|
20
55
|
|
|
21
|
-
|
|
56
|
+
| Vấn đề | Nếu để model tự xử lý | UES xử lý thế nào |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| Repository lớn | đọc quá nhiều file, mất context | semantic index + hierarchy L0/L1/L2 + bounded context |
|
|
59
|
+
| Task dài | quên mục tiêu, lặp lại việc | durable work state + PLAN/STATE/EVENTS |
|
|
60
|
+
| Nhiều thay đổi song song | đụng file, ghi đè nhau | task graph + safe waves + worktree sandbox |
|
|
61
|
+
| Không biết test gì | chạy full CI hoặc đoán | detect-tests + verification plan + declared verification commands |
|
|
62
|
+
| Model báo xong quá sớm | false PASS | verifier + integration-verifier + receipts |
|
|
63
|
+
| Retry mù | vá chồng vá | diagnosis-first recovery policy |
|
|
64
|
+
| Log quá lớn | token phình | reversible model-visible compaction |
|
|
65
|
+
| Tool quá nhiều | model chọn sai tool | role allowlist + capability-based routing |
|
|
66
|
+
| UI/browser | đoán thay vì quan sát | Playwright/Browser MCP lane + visual verifier |
|
|
67
|
+
| Kinh nghiệm cũ | nhớ sai hoặc nhiễm | verified persistent memory |
|
|
68
|
+
| Tối ưu không có bằng chứng | nhanh hơn nhưng yếu đi | baseline-vs-UES eval + promotion confidence |
|
|
22
69
|
|
|
23
70
|
---
|
|
24
71
|
|
|
72
|
+
# Kiến trúc tổng thể
|
|
73
|
+
|
|
74
|
+
~~~mermaid
|
|
75
|
+
flowchart TD
|
|
76
|
+
U[User task] --> P[Pi Agent]
|
|
77
|
+
P --> X[UES extension]
|
|
78
|
+
|
|
79
|
+
X --> TP[Task Policy]
|
|
80
|
+
TP --> C[Context Engine]
|
|
81
|
+
TP --> M[Model Policy]
|
|
82
|
+
TP --> W[Workflow Policy]
|
|
83
|
+
|
|
84
|
+
C --> H[Hierarchy L0 L1 L2]
|
|
85
|
+
C --> SI[Semantic Index]
|
|
86
|
+
C --> MEM[Verified Memory]
|
|
87
|
+
C --> CAP[Capability Fabric]
|
|
88
|
+
C --> EV[Evidence Store]
|
|
89
|
+
|
|
90
|
+
W --> A[Specialist Agents]
|
|
91
|
+
W --> TG[Task Graph]
|
|
92
|
+
W --> DW[Dynamic Workflow]
|
|
93
|
+
W --> SB[Worktree Sandbox]
|
|
94
|
+
|
|
95
|
+
A --> EX[Executor]
|
|
96
|
+
A --> VE[Verifier]
|
|
97
|
+
A --> IV[Integration Verifier]
|
|
98
|
+
A --> VV[Visual Verifier]
|
|
99
|
+
|
|
100
|
+
EX --> CHECK[Project-native checks]
|
|
101
|
+
VE --> CHECK
|
|
102
|
+
IV --> CHECK
|
|
103
|
+
VV --> BROWSER[Playwright Browser evidence]
|
|
25
104
|
|
|
26
|
-
|
|
105
|
+
CHECK --> R[Fresh Evidence]
|
|
106
|
+
BROWSER --> R
|
|
107
|
+
R --> G{Verification gates}
|
|
108
|
+
G -->|PASS| DONE[Verified completion]
|
|
109
|
+
G -->|FAIL| REC[Diagnosis and bounded retry]
|
|
110
|
+
REC --> C
|
|
111
|
+
~~~
|
|
27
112
|
|
|
28
|
-
|
|
113
|
+
## Các lớp chính
|
|
29
114
|
|
|
30
|
-
|
|
31
|
-
approved PLAN
|
|
32
|
-
↓
|
|
33
|
-
event-driven DAG
|
|
34
|
-
↓
|
|
35
|
-
same model × N fresh sessions
|
|
36
|
-
↓
|
|
37
|
-
isolated worktrees + resource leases
|
|
38
|
-
↓
|
|
39
|
-
fresh same-model verifier
|
|
40
|
-
↓
|
|
41
|
-
transactional integration queue
|
|
42
|
-
↓
|
|
43
|
-
unlock dependencies immediately
|
|
44
|
-
```
|
|
115
|
+
### 1. Pi host layer
|
|
45
116
|
|
|
46
|
-
|
|
117
|
+
Pi chịu trách nhiệm session, model provider, thinking level, built-in tools và extension runtime.
|
|
47
118
|
|
|
48
|
-
|
|
119
|
+
### 2. UES Pi extension
|
|
49
120
|
|
|
50
|
-
|
|
121
|
+
File chính: <code>pi/extensions/ues.ts</code>.
|
|
51
122
|
|
|
52
|
-
|
|
123
|
+
Extension đăng ký ba tool orchestration:
|
|
53
124
|
|
|
54
|
-
|
|
125
|
+
| Tool | Vai trò |
|
|
126
|
+
|---|---|
|
|
127
|
+
| <code>ues_execute</code> | Chạy task engineering end-to-end |
|
|
128
|
+
| <code>ues_cli</code> | Gọi deterministic UES CLI không qua shell interpolation |
|
|
129
|
+
| <code>ues_dispatch</code> | Gọi specialist child agents theo single / chain / bounded parallel |
|
|
130
|
+
|
|
131
|
+
### 3. Deterministic engine
|
|
132
|
+
|
|
133
|
+
Thư mục <code>lib/</code> chứa các engine cho:
|
|
134
|
+
|
|
135
|
+
- task/risk classification;
|
|
136
|
+
- semantic index;
|
|
137
|
+
- repo graph;
|
|
138
|
+
- context manifest;
|
|
139
|
+
- evidence storage;
|
|
140
|
+
- receipts;
|
|
141
|
+
- work state;
|
|
142
|
+
- task graph;
|
|
143
|
+
- safe-wave scheduling;
|
|
144
|
+
- model routing;
|
|
145
|
+
- memory;
|
|
146
|
+
- capability selection;
|
|
147
|
+
- browser evidence;
|
|
148
|
+
- benchmark/learning;
|
|
149
|
+
- safety;
|
|
150
|
+
- Windows compatibility.
|
|
151
|
+
|
|
152
|
+
### 4. Specialist layer
|
|
153
|
+
|
|
154
|
+
UES không dùng một prompt khổng lồ cho mọi việc. Nó có 12 specialist roles với tool boundary khác nhau.
|
|
55
155
|
|
|
56
|
-
|
|
57
|
-
- `npm test`;
|
|
58
|
-
- `npm run ci`;
|
|
59
|
-
- `npm pack --dry-run`;
|
|
60
|
-
- packed-install smoke và plain-install smoke;
|
|
61
|
-
- live OpenCode V2 check: router load, `/ues-run` FAST/STANDARD/DEEP admission, prompt dài, MCP/provider path và restart trên session mới;
|
|
62
|
-
- npm 11+ có thể chặn lifecycle script theo `allowScripts`; `ocskill install` vẫn là resource-sync fallback chính thức.
|
|
156
|
+
### 5. Verification layer
|
|
63
157
|
|
|
158
|
+
Hoàn thành không đồng nghĩa model nói “done”. UES cố gắng ràng buộc completion với fresh evidence, receipt và verifier độc lập.
|
|
64
159
|
|
|
65
160
|
---
|
|
66
161
|
|
|
162
|
+
# Luồng /ues-run end-to-end
|
|
163
|
+
|
|
164
|
+
<code>/ues-run</code> là entry point khuyến nghị cho engineering task.
|
|
165
|
+
|
|
166
|
+
~~~mermaid
|
|
167
|
+
sequenceDiagram
|
|
168
|
+
participant U as User
|
|
169
|
+
participant P as Pi
|
|
170
|
+
participant UES as UES Controller
|
|
171
|
+
participant CTX as Context Engine
|
|
172
|
+
participant EX as Executor
|
|
173
|
+
participant V as Verifier
|
|
174
|
+
participant IV as Integration Verifier
|
|
175
|
+
participant VV as Visual Verifier
|
|
176
|
+
|
|
177
|
+
U->>P: /ues-run task
|
|
178
|
+
P->>UES: ues_execute(task)
|
|
179
|
+
UES->>UES: classify task/risk/profile
|
|
180
|
+
UES->>CTX: build bounded context
|
|
181
|
+
CTX-->>UES: hierarchy + evidence + memory + capability hints
|
|
182
|
+
|
|
183
|
+
alt long/high risk
|
|
184
|
+
UES->>UES: architect + structured plan
|
|
185
|
+
UES->>UES: plan-checker gate
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
UES->>EX: fresh specialist execution
|
|
189
|
+
EX-->>UES: implementation handoff
|
|
190
|
+
|
|
191
|
+
UES->>V: independent verification
|
|
192
|
+
V-->>UES: PASS / FAIL / PARTIAL
|
|
193
|
+
|
|
194
|
+
alt integration required
|
|
195
|
+
UES->>IV: cross-task/final repository verification
|
|
196
|
+
IV-->>UES: PASS / FAIL / PARTIAL
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
alt visual/browser evidence required
|
|
200
|
+
UES->>VV: rendered-state verification
|
|
201
|
+
VV-->>UES: PASS / FAIL / PARTIAL
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
alt all required gates PASS
|
|
205
|
+
UES-->>P: verified completion
|
|
206
|
+
P-->>U: final result
|
|
207
|
+
else failure
|
|
208
|
+
UES->>UES: diagnosis / recovery / bounded retry
|
|
209
|
+
end
|
|
210
|
+
~~~
|
|
211
|
+
|
|
212
|
+
## UES không làm gì ở luồng này?
|
|
213
|
+
|
|
214
|
+
- không tự push;
|
|
215
|
+
- không tự publish npm;
|
|
216
|
+
- không tự deploy production;
|
|
217
|
+
- không coi executor report là bằng chứng hoàn thành;
|
|
218
|
+
- không bỏ verifier chỉ vì compile pass;
|
|
219
|
+
- không lưu hidden chain-of-thought.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
# Task Policy: FAST / STANDARD / DEEP
|
|
224
|
+
|
|
225
|
+
Task Policy nằm trong <code>lib/task-policy.mjs</code> và phân loại task theo tín hiệu có thể quan sát.
|
|
226
|
+
|
|
227
|
+
~~~mermaid
|
|
228
|
+
flowchart LR
|
|
229
|
+
T[Task text + repo facts] --> S[Risk and complexity signals]
|
|
67
230
|
|
|
68
|
-
|
|
231
|
+
S --> F{Classification}
|
|
232
|
+
F -->|low + bounded| FAST[FAST]
|
|
233
|
+
F -->|medium| STD[STANDARD]
|
|
234
|
+
F -->|long horizon or high risk| DEEP[DEEP]
|
|
69
235
|
|
|
70
|
-
|
|
236
|
+
FAST --> F1[8k context budget]
|
|
237
|
+
FAST --> F2[max 2 skills]
|
|
238
|
+
FAST --> F3[targeted verification]
|
|
71
239
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
240
|
+
STD --> S1[20k context budget]
|
|
241
|
+
STD --> S2[max 4 skills]
|
|
242
|
+
STD --> S3[targeted + affected verification]
|
|
75
243
|
|
|
76
|
-
|
|
244
|
+
DEEP --> D1[48k context budget]
|
|
245
|
+
DEEP --> D2[max 5 skills]
|
|
246
|
+
DEEP --> D3[plan + integration + durable state]
|
|
247
|
+
~~~
|
|
77
248
|
|
|
78
|
-
|
|
79
|
-
npm install -g opencode-agent-skill
|
|
80
|
-
```
|
|
249
|
+
## FAST
|
|
81
250
|
|
|
82
|
-
|
|
251
|
+
Dành cho task nhỏ, low-risk, bounded.
|
|
83
252
|
|
|
84
|
-
|
|
85
|
-
npm install -g opencode-agent-skill@next
|
|
86
|
-
ocskill install
|
|
87
|
-
```
|
|
253
|
+
Đặc điểm:
|
|
88
254
|
|
|
89
|
-
|
|
255
|
+
- context budget mặc định khoảng 8k;
|
|
256
|
+
- tối đa 2 skills;
|
|
257
|
+
- direct skill loading;
|
|
258
|
+
- không bắt durable work;
|
|
259
|
+
- verification targeted;
|
|
260
|
+
- không bật full CI mặc định.
|
|
90
261
|
|
|
91
|
-
|
|
92
|
-
npm install -g .
|
|
93
|
-
ocskill install
|
|
94
|
-
```
|
|
262
|
+
## STANDARD
|
|
95
263
|
|
|
96
|
-
|
|
264
|
+
Dành cho task vừa, có debugging/change scope đáng kể.
|
|
97
265
|
|
|
98
|
-
|
|
99
|
-
ocskill version
|
|
100
|
-
ocskill status
|
|
101
|
-
ocskill doctor
|
|
102
|
-
```
|
|
266
|
+
Đặc điểm:
|
|
103
267
|
|
|
104
|
-
|
|
268
|
+
- context budget khoảng 20k;
|
|
269
|
+
- tối đa 4 skills;
|
|
270
|
+
- selective skill loading;
|
|
271
|
+
- affected verification;
|
|
272
|
+
- worktree khi có conflict.
|
|
105
273
|
|
|
106
|
-
|
|
107
|
-
ocskill install
|
|
108
|
-
```
|
|
274
|
+
## DEEP
|
|
109
275
|
|
|
110
|
-
|
|
276
|
+
Dành cho long-horizon/high-risk.
|
|
111
277
|
|
|
112
|
-
|
|
278
|
+
Đặc điểm:
|
|
113
279
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
280
|
+
- context budget đến khoảng 48k;
|
|
281
|
+
- tối đa 5 skills;
|
|
282
|
+
- structured plan;
|
|
283
|
+
- durable state;
|
|
284
|
+
- plan checker;
|
|
285
|
+
- worktree cho writers;
|
|
286
|
+
- integration verification;
|
|
287
|
+
- full CI policy;
|
|
288
|
+
- critic ở high-risk/final paths.
|
|
117
289
|
|
|
118
|
-
|
|
290
|
+
## High-risk signals
|
|
291
|
+
|
|
292
|
+
UES phân biệt “chỉ nhắc tới database/security” với “thực sự thay đổi database/security”.
|
|
293
|
+
|
|
294
|
+
Những thay đổi như sau có thể nâng risk:
|
|
295
|
+
|
|
296
|
+
- auth/permission/security mutation;
|
|
297
|
+
- payment flow;
|
|
298
|
+
- database/schema migration;
|
|
299
|
+
- production deploy;
|
|
300
|
+
- secret/credential rotation;
|
|
301
|
+
- breaking public API;
|
|
302
|
+
- destructive Git/database action.
|
|
119
303
|
|
|
120
304
|
---
|
|
121
305
|
|
|
122
|
-
|
|
306
|
+
# 12 specialist agents
|
|
307
|
+
|
|
308
|
+
Thư mục: <code>global-config/agents/</code>.
|
|
309
|
+
|
|
310
|
+
| Agent | Nhiệm vụ | Có ghi file? | Khi dùng |
|
|
311
|
+
|---|---|---:|---|
|
|
312
|
+
| architect | thiết kế plan/contract/dependency | không | task phức tạp, long-horizon |
|
|
313
|
+
| codebase-mapper | đọc repo và map scope | không | repo lớn/không rõ vị trí |
|
|
314
|
+
| critic | phản biện plan/solution | không | high-risk hoặc recovery sâu |
|
|
315
|
+
| debugger | tìm nguyên nhân gốc từ evidence | không | bug/failure/retry |
|
|
316
|
+
| executor | thực thi thay đổi nhỏ nhất hợp lý | có | implementation |
|
|
317
|
+
| integration-verifier | kiểm tra final cross-task state | không | standard/deep/high-risk |
|
|
318
|
+
| merge-arbiter | xử lý integration/merge boundary | có | conflict/merge workflow |
|
|
319
|
+
| plan-checker | kiểm tra plan có grounded không | không | trước long/high-risk execution |
|
|
320
|
+
| researcher | nghiên cứu bằng chứng | không | uncertainty/external facts |
|
|
321
|
+
| reviewer | review thay đổi | không | code review/audit |
|
|
322
|
+
| verifier | fresh independent verification | không | completion gate |
|
|
323
|
+
| visual-verifier | verify rendered UI/browser state | không | visual/browser task |
|
|
324
|
+
|
|
325
|
+
## Quan hệ giữa các agent
|
|
326
|
+
|
|
327
|
+
~~~mermaid
|
|
328
|
+
flowchart TD
|
|
329
|
+
MAP[codebase-mapper] --> ARCH[architect]
|
|
330
|
+
ARCH --> PC[plan-checker]
|
|
331
|
+
PC --> EX[executor]
|
|
332
|
+
|
|
333
|
+
EX --> V[verifier]
|
|
334
|
+
V -->|PASS| IV[integration-verifier]
|
|
335
|
+
V -->|FAIL| D[debugger]
|
|
336
|
+
|
|
337
|
+
D --> EX
|
|
338
|
+
D --> C[critic]
|
|
339
|
+
C --> ARCH
|
|
340
|
+
|
|
341
|
+
IV -->|visual task| VV[visual-verifier]
|
|
342
|
+
IV -->|non visual| DONE[complete]
|
|
343
|
+
VV --> DONE
|
|
344
|
+
|
|
345
|
+
R[researcher] -. evidence .-> ARCH
|
|
346
|
+
R -. evidence .-> D
|
|
347
|
+
REV[reviewer] -. review .-> V
|
|
348
|
+
~~~
|
|
123
349
|
|
|
124
|
-
|
|
350
|
+
---
|
|
125
351
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
352
|
+
# 48 skills
|
|
353
|
+
|
|
354
|
+
UES hiện có 48 skill directories trong <code>global-config/skills/</code>. Skills không phải 48 agent độc lập; chúng là bounded domain instructions để UES chỉ nạp đúng chuyên môn cần thiết.
|
|
355
|
+
|
|
356
|
+
## Nhóm orchestration và reasoning
|
|
357
|
+
|
|
358
|
+
- engineering-orchestrator
|
|
359
|
+
- dynamic-workflow
|
|
360
|
+
- task-planner
|
|
361
|
+
- software-architect
|
|
362
|
+
- context-engineering
|
|
363
|
+
- change-impact-analysis
|
|
364
|
+
- repo-explorer
|
|
365
|
+
- research-verification
|
|
366
|
+
- long-task-state
|
|
367
|
+
- implementation-engineer
|
|
368
|
+
- bug-diagnosis
|
|
369
|
+
- code-review
|
|
370
|
+
- skill-authoring
|
|
371
|
+
- skill-evaluation
|
|
372
|
+
|
|
373
|
+
## Nhóm verification và testing
|
|
374
|
+
|
|
375
|
+
- test-driven-development
|
|
376
|
+
- test-verification
|
|
377
|
+
- accessibility
|
|
378
|
+
- responsive-verification
|
|
379
|
+
- component-visual-testing
|
|
380
|
+
- visual-fidelity
|
|
381
|
+
- browser-qa
|
|
382
|
+
- browser-security
|
|
383
|
+
- web-security-review
|
|
384
|
+
- performance-engineering
|
|
385
|
+
|
|
386
|
+
## Nhóm backend / API / data
|
|
387
|
+
|
|
388
|
+
- api-contract
|
|
389
|
+
- rest-api-design
|
|
390
|
+
- auth-security
|
|
391
|
+
- database-engineering
|
|
392
|
+
- payment-engineering
|
|
393
|
+
- ecommerce-engineering
|
|
394
|
+
- file-upload-engineering
|
|
395
|
+
- dependency-management
|
|
396
|
+
- devops-engineering
|
|
397
|
+
- documentation-engineering
|
|
398
|
+
- git-safety
|
|
399
|
+
|
|
400
|
+
## Nhóm framework / language
|
|
401
|
+
|
|
402
|
+
- nodejs-engineering
|
|
403
|
+
- nextjs-engineering
|
|
404
|
+
- react-engineering
|
|
405
|
+
- react-native-engineering
|
|
406
|
+
- nestjs-engineering
|
|
407
|
+
- fastapi-engineering
|
|
408
|
+
- django-engineering
|
|
409
|
+
- python-engineering
|
|
410
|
+
- java-spring-engineering
|
|
411
|
+
- dotnet-engineering
|
|
412
|
+
- flutter-engineering
|
|
413
|
+
|
|
414
|
+
## Nhóm UI/design
|
|
415
|
+
|
|
416
|
+
- ui-ux-engineering
|
|
417
|
+
- design-source
|
|
418
|
+
|
|
419
|
+
> Mục tiêu của skill routing là progressive disclosure: model không phải đọc tất cả 48 skills cho một task.
|
|
129
420
|
|
|
130
|
-
|
|
421
|
+
---
|
|
131
422
|
|
|
132
|
-
|
|
133
|
-
/ues-resume <slug>
|
|
134
|
-
```
|
|
423
|
+
# 11 slash prompts
|
|
135
424
|
|
|
136
|
-
|
|
425
|
+
Pi package cung cấp 11 slash prompts:
|
|
137
426
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
427
|
+
| Command | Ý nghĩa |
|
|
428
|
+
|---|---|
|
|
429
|
+
| <code>/ues-run</code> | controller end-to-end |
|
|
430
|
+
| <code>/ues-plan</code> | lập kế hoạch |
|
|
431
|
+
| <code>/ues-feature</code> | triển khai feature |
|
|
432
|
+
| <code>/ues-fix</code> | sửa bug |
|
|
433
|
+
| <code>/ues-debug</code> | điều tra failure |
|
|
434
|
+
| <code>/ues-review</code> | review code/scope |
|
|
435
|
+
| <code>/ues-verify</code> | xác minh claim |
|
|
436
|
+
| <code>/ues-audit</code> | audit scope |
|
|
437
|
+
| <code>/ues-research</code> | research |
|
|
438
|
+
| <code>/ues-critique</code> | phản biện proposal |
|
|
439
|
+
| <code>/ues-resume</code> | tiếp tục durable work |
|
|
440
|
+
|
|
441
|
+
~~~mermaid
|
|
442
|
+
flowchart LR
|
|
443
|
+
CMD[Slash command] --> ROUTE[UES router/controller]
|
|
444
|
+
ROUTE --> POLICY[Task policy]
|
|
445
|
+
POLICY --> AGENT[Relevant specialist path]
|
|
446
|
+
AGENT --> EVIDENCE[Fresh evidence]
|
|
447
|
+
EVIDENCE --> RESULT[Result]
|
|
448
|
+
~~~
|
|
145
449
|
|
|
146
450
|
---
|
|
147
451
|
|
|
148
|
-
|
|
452
|
+
# Context Engine L0/L1/L2
|
|
149
453
|
|
|
150
|
-
|
|
454
|
+
Một trong các mục tiêu lớn của UES là **nạp ít context hơn nhưng đúng hơn**.
|
|
151
455
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- responsive viewport matrix và component visual testing/Storybook routing;
|
|
160
|
-
- dynamic workflow scheduler tách deterministic task khỏi LLM/vision fan-out, serialize overlapping writers và giới hạn concurrency;
|
|
161
|
-
- skill linter đo entrypoint size và description collisions; catalog tăng từ 39 lên **48 skills** nhưng router chỉ load skill có tín hiệu hẹp;
|
|
162
|
-
- hai subagent mới: `ues-visual-verifier` và `ues-merge-arbiter`, tổng **12 subagents**;
|
|
163
|
-
- Hermes được nâng thành optional sidecar: UES vẫn sở hữu durable state/evidence/safety, Hermes chỉ nhận bounded schedule/context khi được dùng;
|
|
164
|
-
- Control Center hiển thị Evidence Store và V11 runtime efficiency state.
|
|
456
|
+
~~~mermaid
|
|
457
|
+
flowchart TD
|
|
458
|
+
Q[Task query] --> TERM[Extract bounded terms]
|
|
459
|
+
TERM --> IDX[Semantic index]
|
|
460
|
+
IDX --> H0[L0 routing abstract]
|
|
461
|
+
H0 --> H1[L1 subtree overview]
|
|
462
|
+
H1 --> H2[L2 exact excerpts on demand]
|
|
165
463
|
|
|
166
|
-
|
|
464
|
+
GIT[Git changed files] --> RANK[Ranking]
|
|
465
|
+
DECL[Declared files] --> RANK
|
|
466
|
+
TEST[Likely tests] --> RANK
|
|
467
|
+
SYM[Symbol hits] --> RANK
|
|
468
|
+
MEM[Verified memory] --> RANK
|
|
167
469
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
##
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
- **39 engineering skills**;
|
|
217
|
-
- **11 slash commands**;
|
|
218
|
-
- **10 subagents**;
|
|
219
|
-
- long-task engine bền vững dưới `.ues-work/<slug>/`;
|
|
220
|
-
- `PLAN.json`, `STATE.json`, `EVIDENCE.json` và append-only `EVENTS.jsonl`;
|
|
221
|
-
- structured plan/integration receipts gắn với plan hash hoặc workspace fingerprint;
|
|
222
|
-
- task lease với `runId`, heartbeat, session owner, lease expiry và task-scoped stale recovery;
|
|
223
|
-
- strict verification cho long/high-risk task: receipt phải PASS đúng active run và đúng workspace hiện tại;
|
|
224
|
-
- context manifest v3 với Git-change awareness, symbol hits, TF-IDF-style relevance, tests/instructions và centered excerpts;
|
|
225
|
-
- task policy `inline / standard / long-horizon` cùng model tier `light / standard / heavy`;
|
|
226
|
-
- bounded fresh executor với hard timeout, interrupt/cancel và recovery;
|
|
227
|
-
- safe-wave scheduling cùng Git worktree isolation/integration có conflict detection;
|
|
228
|
-
- learning v2: failure clustering, explicit acceptance và shadow-benchmark promotion;
|
|
229
|
-
- benchmark matrix standard + long-horizon + polyglot;
|
|
230
|
-
- optional Hermes adapter;
|
|
231
|
-
- UES Control Center hiển thị runtime events, receipts và stale recovery;
|
|
232
|
-
- OpenCode V2 router plugin với multilingual routing, safety gate, cancel/recover tools và fresh-session dispatch.
|
|
233
|
-
|
|
234
|
-
V9 bổ sung:
|
|
235
|
-
|
|
236
|
-
- persistent incremental source index dưới `.ues-cache/semantic-index-v1.json` cùng ACI search/refs/view/text;
|
|
237
|
-
- FAST / STANDARD / DEEP execution profiles với bounded context budget, skill cap và verification depth;
|
|
238
|
-
- context manifest v4 tiêu thụ incremental evidence index trước khi mở rộng graph;
|
|
239
|
-
- redacted operational trajectory dưới `.ues-traces/*.jsonl` để replay/debug mà không lưu hidden chain-of-thought;
|
|
240
|
-
- optional container verification sandbox (Docker/Podman) với network-off, dropped capabilities và resource bounds;
|
|
241
|
-
- paired baseline-vs-UES confidence gate qua `npm run evals:matrix:gate`.
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Kiến trúc tác vụ dài
|
|
246
|
-
|
|
247
|
-
Luồng long-horizon chính:
|
|
248
|
-
|
|
249
|
-
```text
|
|
250
|
-
Yêu cầu
|
|
251
|
-
↓
|
|
252
|
-
Khảo sát repository / bằng chứng
|
|
253
|
-
↓
|
|
254
|
-
SPEC.md
|
|
255
|
-
↓
|
|
256
|
-
PLAN.json
|
|
257
|
-
↓
|
|
258
|
-
ues-plan-checker
|
|
259
|
-
↓
|
|
260
|
-
Phê duyệt kế hoạch
|
|
261
|
-
↓
|
|
262
|
-
Các task theo dependency graph
|
|
263
|
-
↓
|
|
264
|
-
Fresh ues-executor session cho từng task
|
|
265
|
-
↓
|
|
266
|
-
Task evidence + durable state
|
|
267
|
-
↓
|
|
268
|
-
ues-integration-verifier
|
|
269
|
-
↓
|
|
270
|
-
Integration PASS
|
|
271
|
-
↓
|
|
272
|
-
Kiểm tra workspace không thay đổi
|
|
273
|
-
↓
|
|
274
|
-
Finalize
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Mỗi work item dùng cấu trúc:
|
|
278
|
-
|
|
279
|
-
```text
|
|
280
|
-
.ues-work/<slug>/
|
|
281
|
-
├── SPEC.md
|
|
282
|
-
├── PLAN.json
|
|
283
|
-
├── STATE.json
|
|
284
|
-
├── EVIDENCE.json
|
|
285
|
-
├── EVENTS.jsonl
|
|
286
|
-
├── tasks/
|
|
287
|
-
└── reports/
|
|
288
|
-
```
|
|
470
|
+
H2 --> RANK
|
|
471
|
+
RANK --> PACK[Bounded context pack]
|
|
472
|
+
PACK --> CHILD[Fresh child agent]
|
|
473
|
+
~~~
|
|
474
|
+
|
|
475
|
+
## L0
|
|
476
|
+
|
|
477
|
+
Routing abstract rất ngắn:
|
|
478
|
+
|
|
479
|
+
- khu vực nào có vẻ liên quan;
|
|
480
|
+
- key symbols;
|
|
481
|
+
- child areas.
|
|
482
|
+
|
|
483
|
+
## L1
|
|
484
|
+
|
|
485
|
+
Scope overview:
|
|
486
|
+
|
|
487
|
+
- file count;
|
|
488
|
+
- extension mix;
|
|
489
|
+
- symbols;
|
|
490
|
+
- bounded file names;
|
|
491
|
+
- subtree relation.
|
|
492
|
+
|
|
493
|
+
## L2
|
|
494
|
+
|
|
495
|
+
Exact excerpts chỉ load khi cần.
|
|
496
|
+
|
|
497
|
+
## Context pack có thể bao gồm
|
|
498
|
+
|
|
499
|
+
- declared files;
|
|
500
|
+
- import neighbors;
|
|
501
|
+
- likely tests;
|
|
502
|
+
- nearby instructions;
|
|
503
|
+
- Git-changed files;
|
|
504
|
+
- semantic references;
|
|
505
|
+
- symbol hits;
|
|
506
|
+
- evidence refs;
|
|
507
|
+
- verified memories;
|
|
508
|
+
- provider hints;
|
|
509
|
+
- recent failure.
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
# Semantic index, repo graph và ACI
|
|
514
|
+
|
|
515
|
+
UES có ba lớp khác nhau; chúng không phải một thứ.
|
|
516
|
+
|
|
517
|
+
## Semantic Index
|
|
289
518
|
|
|
290
|
-
|
|
519
|
+
<code>lib/semantic-index.mjs</code>
|
|
291
520
|
|
|
292
|
-
|
|
521
|
+
Dùng để tạo persistent incremental index phục vụ retrieval.
|
|
293
522
|
|
|
294
|
-
|
|
523
|
+
~~~mermaid
|
|
524
|
+
flowchart LR
|
|
525
|
+
SRC[Source files] --> PARSE[Bounded parse]
|
|
526
|
+
PARSE --> SYMBOLS[Symbols]
|
|
527
|
+
PARSE --> TERMS[Terms]
|
|
528
|
+
SYMBOLS --> INDEX[Persistent semantic index]
|
|
529
|
+
TERMS --> INDEX
|
|
530
|
+
INDEX --> QUERY[Task query]
|
|
531
|
+
QUERY --> RANK[Ranked references]
|
|
532
|
+
~~~
|
|
295
533
|
|
|
296
|
-
|
|
297
|
-
awaiting-plan-approval
|
|
298
|
-
```
|
|
534
|
+
CLI:
|
|
299
535
|
|
|
300
|
-
|
|
536
|
+
~~~text
|
|
537
|
+
ues index status .
|
|
538
|
+
ues index build .
|
|
539
|
+
ues index rebuild .
|
|
540
|
+
~~~
|
|
301
541
|
|
|
302
|
-
|
|
303
|
-
ocskill work gate-receipt <slug> plan . --verifier ues-plan-checker --evidence "plan checker PASS" --out .ues-work/<slug>/reports/plan-receipt.json
|
|
304
|
-
ocskill work approve-plan <slug> . --evidence "plan checker PASS" --receipt-file .ues-work/<slug>/reports/plan-receipt.json
|
|
305
|
-
```
|
|
542
|
+
## Repo Graph
|
|
306
543
|
|
|
307
|
-
|
|
544
|
+
<code>lib/repo-graph.mjs</code>
|
|
308
545
|
|
|
309
|
-
|
|
546
|
+
Tạo bounded import/dependency graph:
|
|
310
547
|
|
|
311
|
-
|
|
548
|
+
- local edges;
|
|
549
|
+
- external imports;
|
|
550
|
+
- coupling hotspots.
|
|
312
551
|
|
|
313
|
-
|
|
314
|
-
ocskill work verify-command <slug> <task-id> . --run-id <run-id> -- npm test
|
|
315
|
-
```
|
|
552
|
+
Nó **không tự nhận là full language-server call graph**.
|
|
316
553
|
|
|
317
|
-
|
|
554
|
+
~~~mermaid
|
|
555
|
+
flowchart LR
|
|
556
|
+
FILES[Source files] --> IMPORTS[Import extraction]
|
|
557
|
+
IMPORTS --> LOCAL[Local dependency edges]
|
|
558
|
+
IMPORTS --> EXT[External import frequency]
|
|
559
|
+
LOCAL --> HOT[Coupling hotspots]
|
|
560
|
+
EXT --> HOT
|
|
561
|
+
~~~
|
|
318
562
|
|
|
319
|
-
|
|
563
|
+
CLI:
|
|
320
564
|
|
|
321
|
-
|
|
565
|
+
~~~text
|
|
566
|
+
ues repo-graph .
|
|
567
|
+
ues repo-graph . --compact
|
|
568
|
+
~~~
|
|
322
569
|
|
|
323
|
-
|
|
324
|
-
ocskill work gate-receipt <slug> integration . --verifier ues-integration-verifier --verdict PASS --evidence "integration PASS" --out .ues-work/<slug>/reports/integration-receipt.json
|
|
325
|
-
ocskill work verify-integration <slug> . --verdict PASS --evidence "integration PASS" --receipt-file .ues-work/<slug>/reports/integration-receipt.json
|
|
326
|
-
```
|
|
570
|
+
## ACI
|
|
327
571
|
|
|
328
|
-
|
|
572
|
+
<code>lib/aci.mjs</code>
|
|
329
573
|
|
|
330
|
-
|
|
331
|
-
ocskill work finalize <slug> . --evidence "final acceptance verified"
|
|
332
|
-
```
|
|
574
|
+
Evidence-first code interface cho:
|
|
333
575
|
|
|
334
|
-
|
|
576
|
+
- search;
|
|
577
|
+
- references;
|
|
578
|
+
- view;
|
|
579
|
+
- bounded text search.
|
|
580
|
+
|
|
581
|
+
CLI:
|
|
582
|
+
|
|
583
|
+
~~~text
|
|
584
|
+
ues aci search ...
|
|
585
|
+
ues aci refs ...
|
|
586
|
+
ues aci view ...
|
|
587
|
+
ues aci text ...
|
|
588
|
+
~~~
|
|
335
589
|
|
|
336
590
|
---
|
|
337
591
|
|
|
338
|
-
|
|
592
|
+
# Model routing và recovery
|
|
593
|
+
|
|
594
|
+
UES không hard-code tên model “mạnh nhất”. Model IDs do người dùng cấu hình.
|
|
595
|
+
|
|
596
|
+
## Tier
|
|
597
|
+
|
|
598
|
+
- light
|
|
599
|
+
- standard
|
|
600
|
+
- heavy
|
|
601
|
+
|
|
602
|
+
Role có default tier, và attempt có thể escalate trong giới hạn cấu hình.
|
|
339
603
|
|
|
340
|
-
|
|
604
|
+
~~~mermaid
|
|
605
|
+
flowchart TD
|
|
606
|
+
TASK[Task] --> CLASS[Task class + risk]
|
|
607
|
+
CLASS --> BASE[Base tier]
|
|
608
|
+
BASE --> CAPS[Required capabilities]
|
|
609
|
+
CAPS --> PERF[Historical model performance]
|
|
610
|
+
PERF --> SELECT[Select configured model]
|
|
341
611
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
612
|
+
SELECT --> RUN[Attempt]
|
|
613
|
+
RUN -->|PASS| DONE[Done]
|
|
614
|
+
RUN -->|FAIL attempt 1| DIAG[Diagnosis]
|
|
615
|
+
DIAG --> RETRY[Attempt 2]
|
|
616
|
+
RETRY -->|FAIL| DEEP[Deep recovery + critic]
|
|
617
|
+
DEEP --> STRONGER[Eligible stronger tier]
|
|
618
|
+
~~~
|
|
345
619
|
|
|
346
|
-
|
|
620
|
+
## Recovery policy
|
|
347
621
|
|
|
348
|
-
|
|
349
|
-
work start
|
|
350
|
-
↓
|
|
351
|
-
đọc bounded context pack
|
|
352
|
-
↓
|
|
353
|
-
chọn model tier theo task + attempt
|
|
354
|
-
↓
|
|
355
|
-
tạo OpenCode session mới
|
|
356
|
-
↓
|
|
357
|
-
switchAgent(ues-executor)
|
|
358
|
-
↓
|
|
359
|
-
switchModel(...) nếu đã cấu hình
|
|
360
|
-
↓
|
|
361
|
-
gửi đúng một task
|
|
362
|
-
↓
|
|
363
|
-
heartbeat + bounded wait
|
|
364
|
-
↓
|
|
365
|
-
interrupt nếu timeout/cancel
|
|
366
|
-
↓
|
|
367
|
-
isolate writer khi cần
|
|
368
|
-
↓
|
|
369
|
-
trả child-session report
|
|
370
|
-
```
|
|
622
|
+
### Attempt 1
|
|
371
623
|
|
|
372
|
-
|
|
624
|
+
- normal bounded context;
|
|
625
|
+
- smallest coherent implementation.
|
|
373
626
|
|
|
374
|
-
|
|
627
|
+
### Attempt 2
|
|
628
|
+
|
|
629
|
+
- dedicated diagnosis;
|
|
630
|
+
- mở rộng context vừa phải;
|
|
631
|
+
- caller/test/failure-adjacent evidence;
|
|
632
|
+
- không vá speculative chồng lên patch cũ.
|
|
633
|
+
|
|
634
|
+
### Attempt 3
|
|
635
|
+
|
|
636
|
+
- deep recovery;
|
|
637
|
+
- semantic + graph + Git context;
|
|
638
|
+
- critic;
|
|
639
|
+
- re-investigate failed hypothesis;
|
|
640
|
+
- architecture/coupling review khi cần.
|
|
375
641
|
|
|
376
642
|
---
|
|
377
643
|
|
|
378
|
-
|
|
644
|
+
# Task graph, Dynamic Workflow và parallel runtime
|
|
379
645
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
646
|
+
Structured plan dùng JSON schema version 1.
|
|
647
|
+
|
|
648
|
+
Mỗi task có thể khai báo:
|
|
649
|
+
|
|
650
|
+
- id;
|
|
651
|
+
- title;
|
|
652
|
+
- summary;
|
|
653
|
+
- dependsOn;
|
|
654
|
+
- files create/modify/test/delete/read;
|
|
655
|
+
- acceptance;
|
|
656
|
+
- verification;
|
|
657
|
+
- optional verificationCommands;
|
|
658
|
+
- risk.
|
|
659
|
+
|
|
660
|
+
## Dependency validation
|
|
661
|
+
|
|
662
|
+
UES kiểm tra:
|
|
663
|
+
|
|
664
|
+
- duplicate IDs;
|
|
665
|
+
- missing dependency;
|
|
666
|
+
- self dependency;
|
|
667
|
+
- cycles;
|
|
668
|
+
- path escape;
|
|
669
|
+
- acceptance/verification thiếu;
|
|
670
|
+
- invalid risk.
|
|
671
|
+
|
|
672
|
+
## Safe waves
|
|
673
|
+
|
|
674
|
+
~~~mermaid
|
|
675
|
+
flowchart TD
|
|
676
|
+
PLAN[PLAN tasks] --> DAG[Dependency DAG]
|
|
677
|
+
DAG --> READY[Ready tasks]
|
|
678
|
+
READY --> FILES[Read/write file scope]
|
|
679
|
+
FILES --> CONFLICT{Conflict?}
|
|
680
|
+
|
|
681
|
+
CONFLICT -->|No| SAME[Same safe wave]
|
|
682
|
+
CONFLICT -->|Yes| SERIAL[Serialize]
|
|
683
|
+
|
|
684
|
+
SAME --> PAR[Bounded parallel execution]
|
|
685
|
+
SERIAL --> NEXT[Later wave]
|
|
686
|
+
~~~
|
|
687
|
+
|
|
688
|
+
Read/read overlap có thể chạy cùng wave. Writer xung đột với reader/writer sẽ bị serialize nếu scope overlap hoặc không đủ rõ.
|
|
689
|
+
|
|
690
|
+
## Dynamic Workflow
|
|
691
|
+
|
|
692
|
+
<code>lib/dynamic-workflow.mjs</code> phân task thành:
|
|
394
693
|
|
|
395
|
-
|
|
694
|
+
- deterministic;
|
|
695
|
+
- inline;
|
|
696
|
+
- agent;
|
|
697
|
+
- vision-related work.
|
|
698
|
+
|
|
699
|
+
~~~mermaid
|
|
700
|
+
flowchart LR
|
|
701
|
+
T[Task] --> K{Kind}
|
|
702
|
+
K -->|test lint typecheck compile| DET[Deterministic]
|
|
703
|
+
K -->|small bounded reasoning| INLINE[Inline]
|
|
704
|
+
K -->|independent substantial work| AG[Agent]
|
|
705
|
+
K -->|visual judgment| VISION[Vision agent]
|
|
706
|
+
|
|
707
|
+
DET --> SAVE[No unnecessary executor slot]
|
|
708
|
+
INLINE --> SAVE
|
|
709
|
+
AG --> SLOT[LLM slot]
|
|
710
|
+
VISION --> VSLOT[Vision slot]
|
|
711
|
+
~~~
|
|
712
|
+
|
|
713
|
+
V14.1 có fast path: deterministic read-only task có thể bỏ executor nhưng **verifier vẫn phải PASS**.
|
|
396
714
|
|
|
397
715
|
---
|
|
398
716
|
|
|
399
|
-
|
|
717
|
+
# Worktree sandbox
|
|
400
718
|
|
|
401
|
-
|
|
719
|
+
Parallel writers không được cùng sửa một checkout.
|
|
402
720
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
721
|
+
~~~mermaid
|
|
722
|
+
sequenceDiagram
|
|
723
|
+
participant R as Root repo
|
|
724
|
+
participant U as UES Scheduler
|
|
725
|
+
participant W1 as Worktree T1
|
|
726
|
+
participant W2 as Worktree T2
|
|
406
727
|
|
|
407
|
-
|
|
728
|
+
U->>R: inspect dirty state
|
|
729
|
+
U->>W1: create isolated worktree
|
|
730
|
+
U->>W2: create isolated worktree
|
|
408
731
|
|
|
409
|
-
|
|
410
|
-
|
|
732
|
+
W1->>W1: execute + verify T1
|
|
733
|
+
W2->>W2: execute + verify T2
|
|
411
734
|
|
|
412
|
-
|
|
413
|
-
|
|
735
|
+
U->>W1: inspect changed files
|
|
736
|
+
U->>W2: inspect changed files
|
|
737
|
+
U->>R: conflict check
|
|
414
738
|
|
|
415
|
-
|
|
739
|
+
alt safe integration
|
|
740
|
+
U->>R: apply T1 patch
|
|
741
|
+
U->>R: apply T2 patch
|
|
742
|
+
else conflict/failure
|
|
743
|
+
U->>R: refuse or rollback integrated wave
|
|
744
|
+
end
|
|
745
|
+
~~~
|
|
416
746
|
|
|
417
|
-
|
|
747
|
+
## Safety của worktree
|
|
418
748
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
| `/ues-research` | Kiểm tra docs, API, package hoặc version |
|
|
426
|
-
| `/ues-review` | Review code hoặc diff |
|
|
427
|
-
| `/ues-verify` | Xác minh bằng evidence mới |
|
|
428
|
-
| `/ues-critique` | Tìm assumption sai và counterexample |
|
|
429
|
-
| `/ues-audit` | Audit repository hoặc một khu vực |
|
|
430
|
-
| `/ues-run` | Chạy workflow long-horizon với durable state |
|
|
431
|
-
| `/ues-resume` | Tiếp tục work item từ `.ues-work` |
|
|
749
|
+
- root dirty mặc định bị chặn nếu không dùng explicit inheritance;
|
|
750
|
+
- dirty root có thể được snapshot vào sandbox theo policy;
|
|
751
|
+
- integration kiểm tra overlap với thay đổi root;
|
|
752
|
+
- branch cleanup chỉ xóa branch namespace UES;
|
|
753
|
+
- rollback dùng reverse patch;
|
|
754
|
+
- không force-push.
|
|
432
755
|
|
|
433
756
|
---
|
|
434
757
|
|
|
435
|
-
|
|
758
|
+
# Evidence Store, receipts và verification gates
|
|
436
759
|
|
|
437
|
-
|
|
760
|
+
## Evidence Store
|
|
438
761
|
|
|
439
|
-
|
|
440
|
-
ocskill task-policy "your engineering request"
|
|
441
|
-
```
|
|
762
|
+
UES có content-addressed Evidence Store.
|
|
442
763
|
|
|
443
|
-
|
|
764
|
+
~~~mermaid
|
|
765
|
+
flowchart LR
|
|
766
|
+
RAW[Raw output / artifact] --> HASH[SHA-256]
|
|
767
|
+
HASH --> STORE[Evidence Store]
|
|
768
|
+
STORE --> REF[evidence:sha256:...]
|
|
769
|
+
REF --> RECEIPT[Verification / memory / gate receipt]
|
|
770
|
+
REF --> GET[Bounded retrieval]
|
|
771
|
+
~~~
|
|
444
772
|
|
|
445
|
-
|
|
446
|
-
ocskill model-policy executor --attempt 1 --text "your engineering request"
|
|
447
|
-
```
|
|
773
|
+
CLI:
|
|
448
774
|
|
|
449
|
-
|
|
775
|
+
~~~text
|
|
776
|
+
ues store status .
|
|
777
|
+
ues store put ...
|
|
778
|
+
ues store get evidence:sha256:<hash>
|
|
779
|
+
ues store gc .
|
|
780
|
+
~~~
|
|
450
781
|
|
|
451
|
-
|
|
452
|
-
light
|
|
453
|
-
standard
|
|
454
|
-
heavy
|
|
455
|
-
```
|
|
782
|
+
## Verification receipts
|
|
456
783
|
|
|
457
|
-
|
|
784
|
+
Receipt có thể bind:
|
|
458
785
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
786
|
+
- command result;
|
|
787
|
+
- output digest;
|
|
788
|
+
- before/after workspace fingerprint;
|
|
789
|
+
- verifier;
|
|
790
|
+
- verdict;
|
|
791
|
+
- active run/task.
|
|
462
792
|
|
|
463
|
-
|
|
793
|
+
Mục tiêu là tránh tình trạng:
|
|
464
794
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
795
|
+
~~~text
|
|
796
|
+
test từng PASS ở trạng thái A
|
|
797
|
+
→ code thay đổi sang trạng thái B
|
|
798
|
+
→ model vẫn dùng PASS cũ để tuyên bố hoàn thành
|
|
799
|
+
~~~
|
|
468
800
|
|
|
469
|
-
|
|
801
|
+
## Gate model
|
|
470
802
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
803
|
+
~~~mermaid
|
|
804
|
+
flowchart TD
|
|
805
|
+
PLAN[Plan] --> PG[Plan checker]
|
|
806
|
+
PG --> PR[Plan receipt]
|
|
807
|
+
PR --> EXEC[Execution]
|
|
476
808
|
|
|
477
|
-
|
|
809
|
+
EXEC --> TV[Task verifier]
|
|
810
|
+
TV --> TR[Task verification receipt]
|
|
478
811
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
ocskill models role plan-checker heavy
|
|
482
|
-
```
|
|
812
|
+
TR --> INT[Integration verifier]
|
|
813
|
+
INT --> IR[Integration receipt]
|
|
483
814
|
|
|
484
|
-
|
|
815
|
+
IR --> FP{Workspace fingerprint unchanged?}
|
|
816
|
+
FP -->|Yes| FINAL[Finalize]
|
|
817
|
+
FP -->|No| INVALID[Receipt stale - reverify]
|
|
818
|
+
~~~
|
|
485
819
|
|
|
486
820
|
---
|
|
487
821
|
|
|
488
|
-
|
|
822
|
+
# V14.1 reversible output compaction
|
|
823
|
+
|
|
824
|
+
Mục tiêu của V14.1 là giảm model-visible noise mà **không bỏ raw evidence**.
|
|
825
|
+
|
|
826
|
+
~~~mermaid
|
|
827
|
+
flowchart TD
|
|
828
|
+
OUT[Large CLI/tool output] --> SIZE{Over limit?}
|
|
829
|
+
SIZE -->|No| RAW[Return unchanged]
|
|
830
|
+
SIZE -->|Yes| SAVE[Store exact raw bytes in Evidence Store]
|
|
831
|
+
SAVE --> PREVIEW[Build head + high-signal + tail preview]
|
|
832
|
+
PREVIEW --> MODEL[Send bounded preview to model]
|
|
833
|
+
MODEL --> NEED{Need more?}
|
|
834
|
+
NEED -->|Yes| REF[Retrieve exact slices by evidence ref]
|
|
835
|
+
NEED -->|No| CONT[Continue]
|
|
836
|
+
~~~
|
|
837
|
+
|
|
838
|
+
Default model-visible limit hiện khoảng 64 KiB.
|
|
839
|
+
|
|
840
|
+
High-signal lines ưu tiên các pattern như:
|
|
841
|
+
|
|
842
|
+
- error;
|
|
843
|
+
- failed;
|
|
844
|
+
- exception;
|
|
845
|
+
- warning;
|
|
846
|
+
- timeout;
|
|
847
|
+
- traceback;
|
|
848
|
+
- mismatch;
|
|
849
|
+
- conflict;
|
|
850
|
+
- passed;
|
|
851
|
+
- tests;
|
|
852
|
+
- exit code;
|
|
853
|
+
- changed.
|
|
854
|
+
|
|
855
|
+
## Quan trọng
|
|
856
|
+
|
|
857
|
+
- thinking level không bị hạ bởi compaction;
|
|
858
|
+
- raw output được lưu trước khi compact;
|
|
859
|
+
- small output giữ nguyên;
|
|
860
|
+
- failure của compaction fail-open về raw output.
|
|
489
861
|
|
|
490
|
-
|
|
491
|
-
|---|---|
|
|
492
|
-
| `ocskill inspect [dir]` | Phát hiện stack, package manager, root và test command |
|
|
493
|
-
| `ocskill repo-graph [dir] [--compact] [--max-files N]` | Lập import graph; dùng `--compact` để lấy hotspot/counts trước, tránh đổ toàn bộ edges trên repo lớn |
|
|
494
|
-
| `ocskill impact <query> [dir]` | Tìm phạm vi ảnh hưởng theo symbol hoặc từ khóa |
|
|
495
|
-
| `ocskill evidence [dir]` | Thu thập snapshot về repository, verification và Git |
|
|
496
|
-
| `ocskill working-tree [dir]` | Kiểm tra branch, HEAD và working tree |
|
|
497
|
-
| `ocskill text-read <file> [--start N] [--max N]` | Đọc bounded UTF-8/UTF-16 an toàn khi generic Read nhận nhầm text là binary |
|
|
498
|
-
| `ocskill review-scope [base] [dir]` | Phân tích changed-file coverage và risk hint |
|
|
499
|
-
| `ocskill verification-plan [dir]` | Đề xuất verification phù hợp với project |
|
|
500
|
-
| `ocskill task-graph <PLAN.json>` | Kiểm tra DAG và tính safe waves |
|
|
501
|
-
| `ocskill context-pack <slug> <task> [dir]` | Tạo bounded handoff cho executor |
|
|
502
|
-
| `ocskill work ...` | Điều khiển durable long-task state machine |
|
|
862
|
+
---
|
|
503
863
|
|
|
504
|
-
|
|
864
|
+
# V14.2 Turbo Weak-Model Runtime
|
|
865
|
+
|
|
866
|
+
V14.2 tối ưu hot path cho model yếu/siêu yếu mà không hạ thinking hoặc bỏ verification gate.
|
|
867
|
+
|
|
868
|
+
~~~mermaid
|
|
869
|
+
flowchart TD
|
|
870
|
+
T[Task] --> P[Task Policy]
|
|
871
|
+
P --> C[Adaptive context]
|
|
872
|
+
C --> G[Semantic + dependency graph rank]
|
|
873
|
+
G --> S[Bounded micro-skills]
|
|
874
|
+
S --> W[Warm Pi RPC worker]
|
|
875
|
+
|
|
876
|
+
W --> E[Executor]
|
|
877
|
+
E --> R[Tool-boundary verification receipts]
|
|
878
|
+
R --> V[Verifier]
|
|
879
|
+
|
|
880
|
+
V -->|fresh receipt fully covers check| REUSE[Reuse exact PASS receipt]
|
|
881
|
+
V -->|missing/stale/high-risk| RUN[Run fresh check]
|
|
882
|
+
|
|
883
|
+
REUSE --> IV[Integration verification when required]
|
|
884
|
+
RUN --> IV
|
|
885
|
+
|
|
886
|
+
E --> O[Large tool output]
|
|
887
|
+
O --> COMP[Command-aware compaction]
|
|
888
|
+
COMP --> RAW[Raw bytes in Evidence Store]
|
|
889
|
+
RAW --> REC[Selective recovery on demand]
|
|
890
|
+
~~~
|
|
891
|
+
|
|
892
|
+
Các thay đổi chính:
|
|
893
|
+
|
|
894
|
+
- warm Pi RPC worker pool với fresh session giữa specialist runs;
|
|
895
|
+
- interactive steering/abort khi một child đang active;
|
|
896
|
+
- unified process-tree supervisor + bounded I/O drain;
|
|
897
|
+
- rolling Jest/open-handle detection;
|
|
898
|
+
- adaptive role-aware context budgets;
|
|
899
|
+
- runtime context + dependency-graph cache theo workspace fingerprint;
|
|
900
|
+
- bounded micro-skill compiler thay vì load toàn bộ skill catalog;
|
|
901
|
+
- affected-test hints;
|
|
902
|
+
- verification receipt reuse chỉ khi fingerprint còn nguyên;
|
|
903
|
+
- high-risk verifier không dùng receipt reuse optimization;
|
|
904
|
+
- child test/lint/typecheck/build có timeout theo profile;
|
|
905
|
+
- full shell output được recover từ Pi `fullOutputPath` khi có;
|
|
906
|
+
- command-aware reversible compaction ngay ở child tool-result boundary;
|
|
907
|
+
- JSON evidence selector để lấy đúng subtree;
|
|
908
|
+
- personalized dependency graph ranking;
|
|
909
|
+
- task-specific Browser MCP subset;
|
|
910
|
+
- confidence-bound weak-model routing;
|
|
911
|
+
- DEEP task auto-promote sang `.ues-work` durable workflow;
|
|
912
|
+
- paired benchmark có turbo promotion gate: **quality non-regression + efficiency gain + zero controller false-PASS**.
|
|
913
|
+
|
|
914
|
+
Các optimization quan trọng có thể rollback riêng:
|
|
915
|
+
|
|
916
|
+
~~~text
|
|
917
|
+
UES_CHILD_RUNTIME=cli
|
|
918
|
+
UES_ADAPTIVE_CONTEXT=0
|
|
919
|
+
UES_MICRO_SKILLS=0
|
|
920
|
+
UES_AFFECTED_TEST_HINTS=0
|
|
921
|
+
UES_CHILD_TOOL_COMPACTION=0
|
|
922
|
+
~~~
|
|
923
|
+
|
|
924
|
+
Chi tiết: `docs/V14.2-TURBO-WEAK-MODEL-RUNTIME.md`.
|
|
925
|
+
|
|
926
|
+
---
|
|
505
927
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
928
|
+
# Verified Persistent Memory
|
|
929
|
+
|
|
930
|
+
Memory của UES không phải “chat memory tự do”. Retrieval chỉ dùng memory đủ điều kiện.
|
|
931
|
+
|
|
932
|
+
~~~mermaid
|
|
933
|
+
flowchart TD
|
|
934
|
+
EXPERIENCE[Task outcome] --> CAND[Memory candidate]
|
|
935
|
+
CAND --> EVID{Has durable evidence?}
|
|
936
|
+
EVID -->|No| DROP[Not retrievable]
|
|
937
|
+
EVID -->|Yes| VER{Verifier PASS?}
|
|
938
|
+
VER -->|No| DROP
|
|
939
|
+
VER -->|Yes| VM[Verified memory]
|
|
940
|
+
|
|
941
|
+
VM --> RANK[Hybrid retrieval]
|
|
942
|
+
RANK --> LEX[Lexical relevance]
|
|
943
|
+
RANK --> VEC[Deterministic vector similarity]
|
|
944
|
+
RANK --> FILE[File affinity]
|
|
945
|
+
RANK --> REC[Recency/confidence]
|
|
946
|
+
RANK --> TASK[Task-class affinity]
|
|
947
|
+
|
|
948
|
+
LEX --> TOP[Bounded top memories]
|
|
949
|
+
VEC --> TOP
|
|
950
|
+
FILE --> TOP
|
|
951
|
+
REC --> TOP
|
|
952
|
+
TASK --> TOP
|
|
953
|
+
~~~
|
|
954
|
+
|
|
955
|
+
Memory hỗ trợ:
|
|
956
|
+
|
|
957
|
+
- candidate / verified / superseded lifecycle;
|
|
958
|
+
- confidence;
|
|
959
|
+
- expiry;
|
|
960
|
+
- task-class affinity;
|
|
961
|
+
- usage accounting;
|
|
962
|
+
- evidence references;
|
|
963
|
+
- supersession.
|
|
964
|
+
|
|
965
|
+
CLI:
|
|
966
|
+
|
|
967
|
+
~~~text
|
|
968
|
+
ues memory status .
|
|
969
|
+
ues memory retrieve ...
|
|
970
|
+
ues memory propose ...
|
|
971
|
+
ues memory verify ...
|
|
972
|
+
ues memory supersede ...
|
|
973
|
+
~~~
|
|
513
974
|
|
|
514
975
|
---
|
|
515
976
|
|
|
516
|
-
|
|
977
|
+
# Capability Fabric
|
|
978
|
+
|
|
979
|
+
Capability Fabric giúp model không phải tự đoán backend/tool nào đang khỏe.
|
|
980
|
+
|
|
981
|
+
## Built-in capability groups
|
|
517
982
|
|
|
518
|
-
|
|
983
|
+
Source hiện có các nhóm như:
|
|
519
984
|
|
|
520
|
-
|
|
985
|
+
- code.search;
|
|
986
|
+
- memory;
|
|
987
|
+
- evidence;
|
|
988
|
+
- output.compaction;
|
|
989
|
+
- filesystem;
|
|
990
|
+
- git;
|
|
991
|
+
- agent.host;
|
|
992
|
+
- github;
|
|
993
|
+
- browser.
|
|
521
994
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
- `ues-bug-diagnosis`
|
|
528
|
-
- `ues-test-driven-development`
|
|
529
|
-
- `ues-test-verification`
|
|
530
|
-
- `ues-code-review`
|
|
531
|
-
- `ues-research-verification`
|
|
532
|
-
- `ues-long-task-state`
|
|
533
|
-
- `ues-git-safety`
|
|
995
|
+
~~~mermaid
|
|
996
|
+
flowchart TD
|
|
997
|
+
NEED[Required capability] --> REG[Provider registry]
|
|
998
|
+
REG --> PROBE[Health probe]
|
|
999
|
+
PROBE --> SCORE[Score]
|
|
534
1000
|
|
|
535
|
-
|
|
1001
|
+
OBS[Persisted success/failure/latency] --> SCORE
|
|
1002
|
+
QUALITY[Quality] --> SCORE
|
|
1003
|
+
COST[Cost class] --> SCORE
|
|
1004
|
+
LAT[Latency class] --> SCORE
|
|
1005
|
+
|
|
1006
|
+
SCORE --> PRIMARY[Selected provider]
|
|
1007
|
+
SCORE --> FALLBACK[Fallback providers]
|
|
1008
|
+
~~~
|
|
1009
|
+
|
|
1010
|
+
Provider score xét:
|
|
1011
|
+
|
|
1012
|
+
- configured priority;
|
|
1013
|
+
- quality;
|
|
1014
|
+
- current health;
|
|
1015
|
+
- historical success/failure;
|
|
1016
|
+
- cost class;
|
|
1017
|
+
- latency class.
|
|
1018
|
+
|
|
1019
|
+
## Output compaction providers
|
|
1020
|
+
|
|
1021
|
+
V14.1 có registry cho:
|
|
1022
|
+
|
|
1023
|
+
- built-in <code>ues-reversible-compactor</code> — mặc định;
|
|
1024
|
+
- RTK CLI — optional;
|
|
1025
|
+
- Caveman CLI — optional experimental;
|
|
1026
|
+
- Headroom CLI — optional experimental.
|
|
1027
|
+
|
|
1028
|
+
Detection **không có nghĩa auto-enable** external provider.
|
|
536
1029
|
|
|
537
1030
|
---
|
|
538
1031
|
|
|
539
|
-
|
|
1032
|
+
# Playwright / Browser MCP on-demand
|
|
1033
|
+
|
|
1034
|
+
UES có browser adapter/runtime riêng và thêm routing cho Playwright/Browser MCP đang có trong Pi host.
|
|
1035
|
+
|
|
1036
|
+
Mục tiêu: browser tools chỉ xuất hiện khi task thực sự cần browser/visual evidence.
|
|
1037
|
+
|
|
1038
|
+
~~~mermaid
|
|
1039
|
+
flowchart TD
|
|
1040
|
+
TASK[Task] --> NEED{Needs browser or visual evidence?}
|
|
540
1041
|
|
|
541
|
-
|
|
1042
|
+
NEED -->|No| NORMAL[Normal agent tool allowlist]
|
|
1043
|
+
NEED -->|Yes| DISCOVER[Inspect host Pi tool registry]
|
|
542
1044
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
- không cài V2 runtime plugin;
|
|
546
|
-
- durable long-task CLI vẫn dùng được;
|
|
547
|
-
- không có V2 `ues.dispatch_task`.
|
|
1045
|
+
DISCOVER --> SELECT[Select Playwright/browser tools]
|
|
1046
|
+
SELECT --> CHILD[Add selected names to child --tools]
|
|
548
1047
|
|
|
549
|
-
|
|
1048
|
+
CHILD --> SNAP[Semantic/accessibility snapshot]
|
|
1049
|
+
CHILD --> INT[Targeted interaction]
|
|
1050
|
+
CHILD --> LOG[Console/network evidence]
|
|
1051
|
+
CHILD --> SHOT[Screenshot when visual proof needed]
|
|
550
1052
|
|
|
551
|
-
|
|
1053
|
+
SNAP --> VV[Visual verifier]
|
|
1054
|
+
INT --> VV
|
|
1055
|
+
LOG --> VV
|
|
1056
|
+
SHOT --> VV
|
|
552
1057
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
1058
|
+
VV -->|PASS| DONE[Visual claim verified]
|
|
1059
|
+
VV -->|FAIL / no evidence| STOP[No browser-visible PASS claim]
|
|
1060
|
+
~~~
|
|
556
1061
|
|
|
557
|
-
|
|
1062
|
+
## Routing behavior
|
|
558
1063
|
|
|
559
|
-
|
|
560
|
-
- context guardrail;
|
|
561
|
-
- permission safety gate;
|
|
562
|
-
- read-only long-task helpers;
|
|
563
|
-
- fresh-session executor runtime qua `ues.dispatch_task` và same-model parallel runtime qua `ues.dispatch_parallel`.
|
|
1064
|
+
### Backend task
|
|
564
1065
|
|
|
565
|
-
|
|
1066
|
+
Ví dụ:
|
|
1067
|
+
|
|
1068
|
+
~~~text
|
|
1069
|
+
/ues-run sửa transaction inventory backend và chạy test
|
|
1070
|
+
~~~
|
|
1071
|
+
|
|
1072
|
+
Playwright không cần được thêm vào child agent.
|
|
1073
|
+
|
|
1074
|
+
### Browser E2E task
|
|
1075
|
+
|
|
1076
|
+
Ví dụ:
|
|
1077
|
+
|
|
1078
|
+
~~~text
|
|
1079
|
+
/ues-run kiểm tra checkout form bằng browser, click flow và console error
|
|
1080
|
+
~~~
|
|
1081
|
+
|
|
1082
|
+
Browser MCP lane được yêu cầu.
|
|
1083
|
+
|
|
1084
|
+
### Visual task
|
|
1085
|
+
|
|
1086
|
+
Ví dụ:
|
|
1087
|
+
|
|
1088
|
+
~~~text
|
|
1089
|
+
/ues-run sửa giao diện theo ảnh mẫu và kiểm tra responsive
|
|
1090
|
+
~~~
|
|
1091
|
+
|
|
1092
|
+
Sau code verifier/integration verifier, UES có thể chạy thêm <code>ues-visual-verifier</code>.
|
|
1093
|
+
|
|
1094
|
+
## Evidence order
|
|
1095
|
+
|
|
1096
|
+
UES ưu tiên:
|
|
1097
|
+
|
|
1098
|
+
1. semantic/accessibility snapshot;
|
|
1099
|
+
2. DOM/target state;
|
|
1100
|
+
3. targeted interaction;
|
|
1101
|
+
4. console/network evidence;
|
|
1102
|
+
5. viewport checks;
|
|
1103
|
+
6. screenshot khi cần visual proof.
|
|
1104
|
+
|
|
1105
|
+
## Browser security
|
|
1106
|
+
|
|
1107
|
+
Webpage text, accessibility content, console output và network payload được coi là **untrusted external evidence**.
|
|
1108
|
+
|
|
1109
|
+
Page content không được:
|
|
1110
|
+
|
|
1111
|
+
- thay đổi permissions;
|
|
1112
|
+
- yêu cầu secret;
|
|
1113
|
+
- override system/task instructions;
|
|
1114
|
+
- tự cấp quyền external/destructive side effect.
|
|
1115
|
+
|
|
1116
|
+
## Optional overrides
|
|
1117
|
+
|
|
1118
|
+
Nếu Browser MCP dùng tên tool lạ:
|
|
566
1119
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
```
|
|
1120
|
+
~~~cmd
|
|
1121
|
+
set UES_BROWSER_MCP_TOOL_NAMES=browser_navigate,browser_snapshot,browser_screenshot,browser_click
|
|
1122
|
+
set UES_BROWSER_MCP_TOOL_LIMIT=14
|
|
1123
|
+
~~~
|
|
572
1124
|
|
|
573
1125
|
---
|
|
574
1126
|
|
|
575
|
-
|
|
1127
|
+
# Trajectory và observability
|
|
576
1128
|
|
|
577
|
-
|
|
1129
|
+
<code>lib/trajectory.mjs</code> lưu **operational events**, không lưu hidden chain-of-thought.
|
|
578
1130
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
- Terraform, Kubernetes hoặc Helm action có tác động lớn.
|
|
1131
|
+
~~~mermaid
|
|
1132
|
+
flowchart LR
|
|
1133
|
+
RUN[Agent run] --> EVT[Observable event]
|
|
1134
|
+
EVT --> SCRUB[Secret redaction]
|
|
1135
|
+
SCRUB --> LIMIT[Bound event size]
|
|
1136
|
+
LIMIT --> JSONL[.ues-traces trace.jsonl]
|
|
586
1137
|
|
|
587
|
-
|
|
1138
|
+
JSONL --> SHOW[trace show]
|
|
1139
|
+
JSONL --> DEBUG[Debug/replay analysis]
|
|
1140
|
+
~~~
|
|
1141
|
+
|
|
1142
|
+
Trajectory scrub các dạng dữ liệu như:
|
|
1143
|
+
|
|
1144
|
+
- Authorization Bearer;
|
|
1145
|
+
- OpenAI-style API keys;
|
|
1146
|
+
- GitHub tokens;
|
|
1147
|
+
- npm tokens;
|
|
1148
|
+
- generic api_key/token/secret/password/credential fields.
|
|
1149
|
+
|
|
1150
|
+
Large event payload được bounded và có SHA-256 digest.
|
|
1151
|
+
|
|
1152
|
+
CLI:
|
|
1153
|
+
|
|
1154
|
+
~~~text
|
|
1155
|
+
ues trace append ...
|
|
1156
|
+
ues trace show ...
|
|
1157
|
+
~~~
|
|
588
1158
|
|
|
589
1159
|
---
|
|
590
1160
|
|
|
591
|
-
|
|
1161
|
+
# Learning engine và benchmark confidence
|
|
592
1162
|
|
|
593
|
-
|
|
1163
|
+
Learning của UES được thiết kế theo hướng **proposal → shadow evidence → promotion**, không phải “agent fail một lần rồi tự sửa rule vĩnh viễn”.
|
|
594
1164
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
1165
|
+
~~~mermaid
|
|
1166
|
+
flowchart TD
|
|
1167
|
+
EVAL[Eval artifacts] --> ANALYZE[Analyze recurring failures]
|
|
1168
|
+
ANALYZE --> PROP[Learning proposal]
|
|
1169
|
+
PROP --> ACCEPT[Manual acceptance]
|
|
1170
|
+
ACCEPT --> SHADOW[Shadow benchmark required]
|
|
598
1171
|
|
|
599
|
-
|
|
1172
|
+
SHADOW --> PAIR[Paired baseline vs UES]
|
|
1173
|
+
PAIR --> CONF[Statistical confidence checks]
|
|
600
1174
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1175
|
+
CONF -->|Eligible| PROMOTE[Promote learning]
|
|
1176
|
+
CONF -->|Not eligible| HOLD[Keep unpromoted]
|
|
1177
|
+
~~~
|
|
604
1178
|
|
|
605
|
-
|
|
1179
|
+
## Failure patterns được phân tích
|
|
606
1180
|
|
|
607
|
-
|
|
608
|
-
ocskill learn accept <proposal-id> .
|
|
609
|
-
```
|
|
1181
|
+
Ví dụ:
|
|
610
1182
|
|
|
611
|
-
|
|
1183
|
+
- hard-timeout;
|
|
1184
|
+
- idle-timeout;
|
|
1185
|
+
- agent-exit;
|
|
1186
|
+
- grader-failure;
|
|
1187
|
+
- orchestration-failure;
|
|
1188
|
+
- telemetry parse errors.
|
|
612
1189
|
|
|
613
|
-
|
|
614
|
-
ocskill learn promote <proposal-id> . --baseline 0.50 --candidate 0.75 --samples 4
|
|
615
|
-
```
|
|
1190
|
+
## Promotion confidence
|
|
616
1191
|
|
|
617
|
-
|
|
1192
|
+
<code>lib/benchmark-confidence.mjs</code> so sánh paired baseline/UES:
|
|
1193
|
+
|
|
1194
|
+
- total paired samples;
|
|
1195
|
+
- both pass;
|
|
1196
|
+
- both fail;
|
|
1197
|
+
- baseline-only win;
|
|
1198
|
+
- UES-only win;
|
|
1199
|
+
- pass-rate delta;
|
|
1200
|
+
- exact sign-test p-value;
|
|
1201
|
+
- per-suite regression;
|
|
1202
|
+
- duration ratio;
|
|
1203
|
+
- initial input ratio;
|
|
1204
|
+
- token ratio;
|
|
1205
|
+
- cost summary.
|
|
1206
|
+
|
|
1207
|
+
Promotion yêu cầu nhiều điều kiện cùng đạt, không chỉ “UES thắng một vài task”.
|
|
618
1208
|
|
|
619
1209
|
---
|
|
620
1210
|
|
|
621
|
-
|
|
1211
|
+
# Durable long-horizon work
|
|
622
1212
|
|
|
623
|
-
|
|
1213
|
+
Task dài có thể dùng <code>.ues-work/<slug>/</code> làm source of truth.
|
|
624
1214
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
1215
|
+
~~~text
|
|
1216
|
+
.ues-work/<slug>/
|
|
1217
|
+
SPEC.md
|
|
1218
|
+
PLAN.json
|
|
1219
|
+
STATE.json
|
|
1220
|
+
EVIDENCE.json
|
|
1221
|
+
EVENTS.jsonl
|
|
1222
|
+
ACTIVE_PLAN.json
|
|
1223
|
+
tasks/
|
|
1224
|
+
reports/
|
|
1225
|
+
plans/
|
|
1226
|
+
~~~
|
|
1227
|
+
|
|
1228
|
+
## State machine khái quát
|
|
1229
|
+
|
|
1230
|
+
~~~mermaid
|
|
1231
|
+
stateDiagram-v2
|
|
1232
|
+
[*] --> Initialized
|
|
1233
|
+
Initialized --> Planned
|
|
1234
|
+
Planned --> PlanApproved
|
|
1235
|
+
PlanApproved --> Running
|
|
1236
|
+
Running --> Running: next task
|
|
1237
|
+
Running --> Blocked
|
|
1238
|
+
Blocked --> Running
|
|
1239
|
+
Running --> IntegrationVerification
|
|
1240
|
+
IntegrationVerification --> Finalized: PASS + fresh fingerprint
|
|
1241
|
+
IntegrationVerification --> Running: FAIL / rework
|
|
1242
|
+
Running --> Recovering: stale lease / interruption
|
|
1243
|
+
Recovering --> Running
|
|
1244
|
+
~~~
|
|
1245
|
+
|
|
1246
|
+
## Locking
|
|
1247
|
+
|
|
1248
|
+
State/evidence mutation dùng:
|
|
1249
|
+
|
|
1250
|
+
- per-work lock;
|
|
1251
|
+
- heartbeat;
|
|
1252
|
+
- stale lock recovery;
|
|
1253
|
+
- atomic file replacement.
|
|
1254
|
+
|
|
1255
|
+
## Runtime events
|
|
1256
|
+
|
|
1257
|
+
<code>EVENTS.jsonl</code> append-only cho operational observability.
|
|
1258
|
+
|
|
1259
|
+
---
|
|
630
1260
|
|
|
631
|
-
|
|
1261
|
+
# Control Center
|
|
1262
|
+
|
|
1263
|
+
UES có local Control Center qua:
|
|
1264
|
+
|
|
1265
|
+
~~~text
|
|
1266
|
+
ues dashboard .
|
|
1267
|
+
ues dashboard . --serve
|
|
1268
|
+
~~~
|
|
1269
|
+
|
|
1270
|
+
Control Center tổng hợp các loại dữ liệu như:
|
|
1271
|
+
|
|
1272
|
+
- durable work;
|
|
1273
|
+
- task state;
|
|
1274
|
+
- blockers;
|
|
1275
|
+
- receipts;
|
|
1276
|
+
- recent events;
|
|
1277
|
+
- eval summaries;
|
|
1278
|
+
- learning state;
|
|
1279
|
+
- evidence store;
|
|
1280
|
+
- verified memory;
|
|
1281
|
+
- capability fabric health.
|
|
1282
|
+
|
|
1283
|
+
~~~mermaid
|
|
1284
|
+
flowchart LR
|
|
1285
|
+
WORK[.ues-work] --> CC[Control Center]
|
|
1286
|
+
EVENTS[EVENTS.jsonl] --> CC
|
|
1287
|
+
EV[Evidence Store] --> CC
|
|
1288
|
+
MEM[Memory] --> CC
|
|
1289
|
+
CAP[Capability Fabric] --> CC
|
|
1290
|
+
LEARN[Learning] --> CC
|
|
1291
|
+
EVAL[Eval artifacts] --> CC
|
|
1292
|
+
~~~
|
|
1293
|
+
|
|
1294
|
+
Control Center là observer/controller cục bộ; nó không bypass verification/safety gates.
|
|
632
1295
|
|
|
633
1296
|
---
|
|
634
1297
|
|
|
635
|
-
|
|
1298
|
+
# Safety model
|
|
1299
|
+
|
|
1300
|
+
UES cố gắng đưa safety vào code thay vì chỉ nhắc model.
|
|
1301
|
+
|
|
1302
|
+
## Shell safety
|
|
1303
|
+
|
|
1304
|
+
Có detection/gate cho các thao tác rủi ro như:
|
|
1305
|
+
|
|
1306
|
+
- force push;
|
|
1307
|
+
- history rewrite;
|
|
1308
|
+
- reset hard;
|
|
1309
|
+
- recursive destructive deletion;
|
|
1310
|
+
- destructive database commands;
|
|
1311
|
+
- deploy/apply;
|
|
1312
|
+
- publish.
|
|
1313
|
+
|
|
1314
|
+
## Scope safety
|
|
1315
|
+
|
|
1316
|
+
Structured task phải khai báo file scope. Scheduler kiểm tra actual changed files so với declared write scope.
|
|
1317
|
+
|
|
1318
|
+
## Parallel safety
|
|
1319
|
+
|
|
1320
|
+
Writer agents chạy parallel phải ở distinct worktree/cwd.
|
|
1321
|
+
|
|
1322
|
+
## Evidence safety
|
|
1323
|
+
|
|
1324
|
+
Old PASS không tự được coi là hợp lệ nếu workspace đã thay đổi.
|
|
1325
|
+
|
|
1326
|
+
## Browser safety
|
|
636
1327
|
|
|
637
|
-
|
|
1328
|
+
External page content là untrusted.
|
|
638
1329
|
|
|
639
|
-
|
|
640
|
-
ocskill dashboard .
|
|
641
|
-
```
|
|
1330
|
+
## Memory safety
|
|
642
1331
|
|
|
643
|
-
|
|
1332
|
+
Candidate hoặc superseded memory không được retrieval như verified memory.
|
|
644
1333
|
|
|
645
|
-
|
|
646
|
-
ocskill dashboard . --serve --port 4177
|
|
647
|
-
```
|
|
1334
|
+
## Learning safety
|
|
648
1335
|
|
|
649
|
-
|
|
1336
|
+
Proposal không tự promote nếu chưa có benchmark evidence phù hợp.
|
|
650
1337
|
|
|
651
1338
|
---
|
|
652
1339
|
|
|
653
|
-
|
|
1340
|
+
# Cài đặt
|
|
654
1341
|
|
|
655
|
-
|
|
1342
|
+
## Yêu cầu
|
|
656
1343
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
1344
|
+
- Node.js 22.19+
|
|
1345
|
+
- Git
|
|
1346
|
+
- Pi Agent
|
|
660
1347
|
|
|
661
|
-
|
|
1348
|
+
Cài Pi:
|
|
662
1349
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
1350
|
+
~~~cmd
|
|
1351
|
+
npm install -g @earendil-works/pi-coding-agent
|
|
1352
|
+
pi --version
|
|
1353
|
+
~~~
|
|
666
1354
|
|
|
667
|
-
|
|
1355
|
+
Cài UES stable từ npm (khuyến nghị):
|
|
668
1356
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
1357
|
+
~~~cmd
|
|
1358
|
+
pi install npm:opencode-agent-skill
|
|
1359
|
+
pi list
|
|
1360
|
+
pi
|
|
1361
|
+
~~~
|
|
672
1362
|
|
|
673
|
-
|
|
1363
|
+
Hoặc cài CLI toàn cục:
|
|
1364
|
+
|
|
1365
|
+
~~~cmd
|
|
1366
|
+
npm install -g opencode-agent-skill@latest
|
|
1367
|
+
ues version
|
|
1368
|
+
~~~
|
|
1369
|
+
|
|
1370
|
+
Cài trực tiếp từ GitHub main nếu muốn dùng source mới nhất:
|
|
1371
|
+
|
|
1372
|
+
~~~cmd
|
|
1373
|
+
pi install git:github.com/laivannha0202/opencode-agent-skill-
|
|
1374
|
+
pi list
|
|
1375
|
+
pi
|
|
1376
|
+
~~~
|
|
1377
|
+
|
|
1378
|
+
Nếu đã clone repo local:
|
|
1379
|
+
|
|
1380
|
+
~~~cmd
|
|
1381
|
+
cd /d E:\Code\opencode-agent-skill-
|
|
1382
|
+
npm install
|
|
1383
|
+
pi install .
|
|
1384
|
+
~~~
|
|
674
1385
|
|
|
675
1386
|
---
|
|
676
1387
|
|
|
677
|
-
|
|
1388
|
+
# Cập nhật
|
|
678
1389
|
|
|
679
|
-
|
|
1390
|
+
Nếu cài từ clone local:
|
|
680
1391
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
- benchmark matrix baseline-vs-UES nhiều trial;
|
|
688
|
-
- một long task tích hợp tới **15 source modules**.
|
|
1392
|
+
~~~cmd
|
|
1393
|
+
cd /d E:\Code\opencode-agent-skill-
|
|
1394
|
+
git status
|
|
1395
|
+
git pull --ff-only origin main
|
|
1396
|
+
pi install .
|
|
1397
|
+
~~~
|
|
689
1398
|
|
|
690
|
-
|
|
1399
|
+
Nếu local có thay đổi chưa commit, hãy backup/stash hoặc xử lý diff trước khi pull. Không nên reset/clean mù quáng.
|
|
691
1400
|
|
|
692
|
-
|
|
693
|
-
npm run evals
|
|
694
|
-
```
|
|
1401
|
+
---
|
|
695
1402
|
|
|
696
|
-
|
|
1403
|
+
# Đóng gói npm
|
|
697
1404
|
|
|
698
|
-
|
|
699
|
-
npm run evals:router
|
|
700
|
-
```
|
|
1405
|
+
Kiểm tra đầy đủ trước khi pack:
|
|
701
1406
|
|
|
702
|
-
|
|
1407
|
+
~~~cmd
|
|
1408
|
+
npm install
|
|
1409
|
+
npm run ci
|
|
1410
|
+
npm pack --dry-run
|
|
1411
|
+
npm pack
|
|
1412
|
+
~~~
|
|
703
1413
|
|
|
704
|
-
|
|
705
|
-
npm run evals:live:validate
|
|
706
|
-
```
|
|
1414
|
+
Package stable hiện tại trong <code>package.json</code> là:
|
|
707
1415
|
|
|
708
|
-
|
|
1416
|
+
~~~text
|
|
1417
|
+
14.4.0
|
|
1418
|
+
~~~
|
|
709
1419
|
|
|
710
|
-
|
|
711
|
-
npm run evals:long:validate
|
|
712
|
-
npm run evals:polyglot:validate
|
|
713
|
-
npm run evals:v11:validate
|
|
714
|
-
```
|
|
1420
|
+
V14.4 gom V14/V14.1/V14.2 cùng code intelligence, hash-anchored editing, completion auditor, stable memory snapshots, reversible context/document ingestion và MCP health-aware routing thành release stable.
|
|
715
1421
|
|
|
716
|
-
|
|
1422
|
+
Test file packed với Pi:
|
|
717
1423
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
```
|
|
1424
|
+
~~~cmd
|
|
1425
|
+
pi install .\opencode-agent-skill-14.4.0.tgz
|
|
1426
|
+
pi list
|
|
1427
|
+
~~~
|
|
723
1428
|
|
|
724
|
-
|
|
1429
|
+
Publish thật chỉ nên thực hiện sau khi CI và package smoke tests PASS.
|
|
1430
|
+
|
|
1431
|
+
---
|
|
725
1432
|
|
|
726
|
-
|
|
1433
|
+
# Các CLI quan trọng
|
|
1434
|
+
|
|
1435
|
+
CLI ưu tiên là <code>ues</code>; <code>ocskill</code> vẫn là compatibility alias.
|
|
1436
|
+
|
|
1437
|
+
## Repository intelligence
|
|
1438
|
+
|
|
1439
|
+
~~~text
|
|
1440
|
+
ues inspect .
|
|
1441
|
+
ues impact <query> .
|
|
1442
|
+
ues evidence .
|
|
1443
|
+
ues working-tree .
|
|
1444
|
+
ues repo-graph .
|
|
1445
|
+
ues index status .
|
|
1446
|
+
ues index build .
|
|
1447
|
+
ues aci search ...
|
|
1448
|
+
~~~
|
|
1449
|
+
|
|
1450
|
+
## Task và verification
|
|
1451
|
+
|
|
1452
|
+
~~~text
|
|
1453
|
+
ues task-policy "<task>"
|
|
1454
|
+
ues verification-plan .
|
|
1455
|
+
ues task-graph PLAN.json
|
|
1456
|
+
ues workflow-plan PLAN.json
|
|
1457
|
+
ues review-scope main .
|
|
1458
|
+
~~~
|
|
1459
|
+
|
|
1460
|
+
## Durable work
|
|
1461
|
+
|
|
1462
|
+
~~~text
|
|
1463
|
+
ues work init <slug> . --goal "..."
|
|
1464
|
+
ues work plan <slug> PLAN.json .
|
|
1465
|
+
ues work approve-plan <slug> . --evidence "..."
|
|
1466
|
+
ues work start <slug> <task-id> .
|
|
1467
|
+
ues work verify-command <slug> <task-id> . --run-id <id> -- npm test
|
|
1468
|
+
ues work complete <slug> <task-id> . --run-id <id> --evidence "..."
|
|
1469
|
+
ues work verify-integration <slug> . --verdict PASS --evidence "..."
|
|
1470
|
+
ues work finalize <slug> . --evidence "..."
|
|
1471
|
+
ues work events <slug> .
|
|
1472
|
+
ues work resume <slug> .
|
|
1473
|
+
~~~
|
|
1474
|
+
|
|
1475
|
+
## Sandbox
|
|
1476
|
+
|
|
1477
|
+
~~~text
|
|
1478
|
+
ues sandbox list .
|
|
1479
|
+
ues sandbox create ...
|
|
1480
|
+
ues sandbox integrate ...
|
|
1481
|
+
ues sandbox rollback ...
|
|
1482
|
+
ues sandbox remove ...
|
|
1483
|
+
~~~
|
|
1484
|
+
|
|
1485
|
+
## Context / memory / capability
|
|
1486
|
+
|
|
1487
|
+
~~~text
|
|
1488
|
+
ues hierarchy "<query>" .
|
|
1489
|
+
ues hierarchy "<query>" . --full
|
|
1490
|
+
ues memory status .
|
|
1491
|
+
ues capability-fabric status .
|
|
1492
|
+
ues capabilities "<task>"
|
|
1493
|
+
~~~
|
|
1494
|
+
|
|
1495
|
+
## Evidence / trace
|
|
1496
|
+
|
|
1497
|
+
~~~text
|
|
1498
|
+
ues store status .
|
|
1499
|
+
ues store get evidence:sha256:<hash>
|
|
1500
|
+
ues trace show ...
|
|
1501
|
+
~~~
|
|
1502
|
+
|
|
1503
|
+
## Browser / visual
|
|
1504
|
+
|
|
1505
|
+
~~~text
|
|
1506
|
+
ues browser capability .
|
|
1507
|
+
ues browser plan ...
|
|
1508
|
+
ues browser inspect ...
|
|
1509
|
+
ues visual ...
|
|
1510
|
+
ues ui tokens ...
|
|
1511
|
+
ues ui layout ...
|
|
1512
|
+
~~~
|
|
1513
|
+
|
|
1514
|
+
## Models
|
|
1515
|
+
|
|
1516
|
+
~~~text
|
|
1517
|
+
ues models status
|
|
1518
|
+
ues models on
|
|
1519
|
+
ues models set light <provider/model>
|
|
1520
|
+
ues models set standard <provider/model>
|
|
1521
|
+
ues models set heavy <provider/model>
|
|
1522
|
+
ues models role verifier standard
|
|
1523
|
+
~~~
|
|
1524
|
+
|
|
1525
|
+
## Learning / eval
|
|
1526
|
+
|
|
1527
|
+
~~~text
|
|
1528
|
+
ues eval-pi --model provider/model --thinking low --suite live --trials 3 --mode both
|
|
1529
|
+
ues learn analyze . --eval-dir .ues-evals
|
|
1530
|
+
~~~
|
|
727
1531
|
|
|
728
1532
|
---
|
|
729
1533
|
|
|
730
|
-
|
|
1534
|
+
# Benchmark model yếu
|
|
731
1535
|
|
|
732
|
-
|
|
1536
|
+
UES có Pi-native baseline-vs-UES benchmark.
|
|
733
1537
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
1538
|
+
~~~mermaid
|
|
1539
|
+
flowchart LR
|
|
1540
|
+
TASKS[Same benchmark tasks] --> B[Baseline Pi]
|
|
1541
|
+
TASKS --> U[Pi + UES]
|
|
737
1542
|
|
|
738
|
-
|
|
1543
|
+
B --> BG[External grader]
|
|
1544
|
+
U --> UG[External grader]
|
|
739
1545
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
```
|
|
1546
|
+
B --> BT[Tokens/cost/tool telemetry]
|
|
1547
|
+
U --> UT[Tokens/cost/tool telemetry]
|
|
743
1548
|
|
|
744
|
-
|
|
1549
|
+
BG --> PAIR[Paired comparison]
|
|
1550
|
+
UG --> PAIR
|
|
1551
|
+
BT --> PAIR
|
|
1552
|
+
UT --> PAIR
|
|
745
1553
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
1554
|
+
PAIR --> CONF[Confidence / regression checks]
|
|
1555
|
+
~~~
|
|
1556
|
+
|
|
1557
|
+
Ví dụ:
|
|
1558
|
+
|
|
1559
|
+
~~~cmd
|
|
1560
|
+
ues eval-pi --model provider/model --thinking low --suite live --trials 3 --mode both
|
|
1561
|
+
~~~
|
|
1562
|
+
|
|
1563
|
+
Eval script thu thập:
|
|
1564
|
+
|
|
1565
|
+
- pass/fail;
|
|
1566
|
+
- duration;
|
|
1567
|
+
- parent tool calls;
|
|
1568
|
+
- child tool calls;
|
|
1569
|
+
- input/output/cache token telemetry;
|
|
1570
|
+
- reported cost;
|
|
1571
|
+
- controller usage;
|
|
1572
|
+
- workspace changes;
|
|
1573
|
+
- external grader result.
|
|
749
1574
|
|
|
750
|
-
|
|
1575
|
+
## Eval suites trong repo
|
|
751
1576
|
|
|
752
|
-
|
|
753
|
-
syntax
|
|
754
|
-
→ resource validation
|
|
755
|
-
→ docs:check
|
|
756
|
-
→ static skill routing
|
|
757
|
-
→ V2 router matrix
|
|
758
|
-
→ standard hidden-grader integrity
|
|
759
|
-
→ long hidden-grader integrity
|
|
760
|
-
→ polyglot hidden-grader integrity
|
|
761
|
-
→ V11 contract validation
|
|
762
|
-
→ Node tests
|
|
763
|
-
→ npm pack --dry-run
|
|
764
|
-
→ packed global-install smoke
|
|
765
|
-
→ plain one-command install compatibility smoke
|
|
766
|
-
```
|
|
1577
|
+
Hiện có các nhóm như:
|
|
767
1578
|
|
|
768
|
-
|
|
1579
|
+
- live;
|
|
1580
|
+
- long;
|
|
1581
|
+
- polyglot;
|
|
1582
|
+
- repo-scale;
|
|
1583
|
+
- v11;
|
|
1584
|
+
- v14;
|
|
1585
|
+
- routing/router trigger suites.
|
|
769
1586
|
|
|
770
1587
|
---
|
|
771
1588
|
|
|
772
|
-
|
|
1589
|
+
# Cấu trúc repository
|
|
1590
|
+
|
|
1591
|
+
~~~text
|
|
1592
|
+
opencode-agent-skill-/
|
|
1593
|
+
├─ bin/
|
|
1594
|
+
│ └─ ocskill.mjs
|
|
1595
|
+
│
|
|
1596
|
+
├─ lib/
|
|
1597
|
+
│ ├─ task-policy.mjs
|
|
1598
|
+
│ ├─ task-engine.mjs
|
|
1599
|
+
│ ├─ task-graph.mjs
|
|
1600
|
+
│ ├─ dynamic-workflow.mjs
|
|
1601
|
+
│ ├─ context-engine-v11.mjs
|
|
1602
|
+
│ ├─ hierarchical-context.mjs
|
|
1603
|
+
│ ├─ semantic-index.mjs
|
|
1604
|
+
│ ├─ repo-graph.mjs
|
|
1605
|
+
│ ├─ aci.mjs
|
|
1606
|
+
│ ├─ evidence-store.mjs
|
|
1607
|
+
│ ├─ evidence-receipt.mjs
|
|
1608
|
+
│ ├─ gate-receipt.mjs
|
|
1609
|
+
│ ├─ memory-engine.mjs
|
|
1610
|
+
│ ├─ capability-fabric.mjs
|
|
1611
|
+
│ ├─ model-policy.mjs
|
|
1612
|
+
│ ├─ model-performance.mjs
|
|
1613
|
+
│ ├─ worktree-sandbox.mjs
|
|
1614
|
+
│ ├─ container-sandbox.mjs
|
|
1615
|
+
│ ├─ performance-fabric.mjs
|
|
1616
|
+
│ ├─ trajectory.mjs
|
|
1617
|
+
│ ├─ learning-engine.mjs
|
|
1618
|
+
│ ├─ benchmark-confidence.mjs
|
|
1619
|
+
│ ├─ browser-adapter.mjs
|
|
1620
|
+
│ ├─ browser-runtime.mjs
|
|
1621
|
+
│ ├─ browser-mcp-routing.mjs
|
|
1622
|
+
│ └─ ...
|
|
1623
|
+
│
|
|
1624
|
+
├─ pi/
|
|
1625
|
+
│ ├─ extensions/
|
|
1626
|
+
│ │ └─ ues.ts
|
|
1627
|
+
│ └─ prompts/
|
|
1628
|
+
│ └─ 11 UES slash prompts
|
|
1629
|
+
│
|
|
1630
|
+
├─ global-config/
|
|
1631
|
+
│ ├─ agents/
|
|
1632
|
+
│ │ └─ 12 specialist agents
|
|
1633
|
+
│ └─ skills/
|
|
1634
|
+
│ └─ 48 domain/workflow skills
|
|
1635
|
+
│
|
|
1636
|
+
├─ evals/
|
|
1637
|
+
│ ├─ live/
|
|
1638
|
+
│ ├─ long/
|
|
1639
|
+
│ ├─ polyglot/
|
|
1640
|
+
│ ├─ repo-scale/
|
|
1641
|
+
│ ├─ v11/
|
|
1642
|
+
│ └─ v14/
|
|
1643
|
+
│
|
|
1644
|
+
├─ scripts/
|
|
1645
|
+
│ └─ eval, validation, smoke, install helpers
|
|
1646
|
+
│
|
|
1647
|
+
├─ test/
|
|
1648
|
+
│ └─ deterministic/runtime/regression tests
|
|
1649
|
+
│
|
|
1650
|
+
└─ docs/
|
|
1651
|
+
├─ ENGINEERING-DESIGN.md
|
|
1652
|
+
├─ DETERMINISTIC-TOOLS.md
|
|
1653
|
+
├─ V11-PERCEPTION-ADAPTIVE-EXECUTION.md
|
|
1654
|
+
├─ V12-WEAK-MODEL-INTELLIGENCE.md
|
|
1655
|
+
├─ V13-PARALLEL-WEAK-MODEL-RUNTIME.md
|
|
1656
|
+
├─ V14-CONTEXT-MEMORY-FABRIC.md
|
|
1657
|
+
└─ V14.1-QUALITY-PERFORMANCE-FABRIC.md
|
|
1658
|
+
~~~
|
|
1659
|
+
|
|
1660
|
+
---
|
|
1661
|
+
|
|
1662
|
+
# Một ví dụ đầy đủ
|
|
1663
|
+
|
|
1664
|
+
Task:
|
|
1665
|
+
|
|
1666
|
+
~~~text
|
|
1667
|
+
/ues-run sửa checkout inventory reservation, chạy test liên quan và xác minh UI checkout
|
|
1668
|
+
~~~
|
|
773
1669
|
|
|
774
|
-
|
|
1670
|
+
Luồng có thể diễn ra:
|
|
775
1671
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
1672
|
+
~~~mermaid
|
|
1673
|
+
flowchart TD
|
|
1674
|
+
T[User task] --> P[Task Policy STANDARD/DEEP]
|
|
1675
|
+
P --> C[Context selection]
|
|
1676
|
+
C --> R[Repo graph + semantic refs + likely tests]
|
|
1677
|
+
R --> E[Executor]
|
|
1678
|
+
E --> TEST[Targeted backend tests]
|
|
1679
|
+
TEST --> V[Verifier]
|
|
779
1680
|
|
|
780
|
-
|
|
1681
|
+
V -->|PASS| I[Integration verifier]
|
|
1682
|
+
V -->|FAIL| D[Debugger]
|
|
1683
|
+
D --> E
|
|
781
1684
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
1685
|
+
I --> B{Visual/browser required?}
|
|
1686
|
+
B -->|No| DONE[Verified completion]
|
|
1687
|
+
B -->|Yes| MCP[Playwright MCP lane]
|
|
1688
|
+
MCP --> VV[Visual verifier]
|
|
1689
|
+
VV -->|PASS| DONE
|
|
1690
|
+
VV -->|FAIL| D
|
|
1691
|
+
~~~
|
|
785
1692
|
|
|
786
|
-
|
|
1693
|
+
Điểm khác với “một model tự làm tất cả” là:
|
|
1694
|
+
|
|
1695
|
+
1. context được bounded;
|
|
1696
|
+
2. implementation và verification tách vai;
|
|
1697
|
+
3. browser evidence chỉ nạp khi cần;
|
|
1698
|
+
4. retry có diagnosis;
|
|
1699
|
+
5. long task có state;
|
|
1700
|
+
6. parallel writers có isolation;
|
|
1701
|
+
7. completion bị ràng buộc bởi evidence.
|
|
787
1702
|
|
|
788
1703
|
---
|
|
789
1704
|
|
|
790
|
-
|
|
1705
|
+
# Triết lý thiết kế
|
|
1706
|
+
|
|
1707
|
+
## Deterministic facts trước probabilistic reasoning
|
|
1708
|
+
|
|
1709
|
+
Những việc có thể tính bằng code thì ưu tiên tính bằng code:
|
|
1710
|
+
|
|
1711
|
+
- Git state;
|
|
1712
|
+
- dependency graph;
|
|
1713
|
+
- changed files;
|
|
1714
|
+
- plan cycle;
|
|
1715
|
+
- file overlap;
|
|
1716
|
+
- command exit status;
|
|
1717
|
+
- workspace fingerprint;
|
|
1718
|
+
- provider health;
|
|
1719
|
+
- token/cost telemetry.
|
|
1720
|
+
|
|
1721
|
+
Model tập trung vào phần cần semantic judgment.
|
|
1722
|
+
|
|
1723
|
+
## Progressive disclosure
|
|
1724
|
+
|
|
1725
|
+
Không nạp:
|
|
1726
|
+
|
|
1727
|
+
- toàn repo;
|
|
1728
|
+
- toàn bộ 48 skills;
|
|
1729
|
+
- mọi MCP tool;
|
|
1730
|
+
- mọi memory;
|
|
1731
|
+
- mọi log.
|
|
1732
|
+
|
|
1733
|
+
Chỉ nạp bounded evidence phù hợp.
|
|
1734
|
+
|
|
1735
|
+
## Fresh specialists
|
|
1736
|
+
|
|
1737
|
+
Child specialist được tạo với prompt/tool boundary hẹp hơn để giảm contamination từ conversation dài.
|
|
791
1738
|
|
|
792
|
-
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
- [V13 Parallel Weak-Model Runtime (beta)](docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md)
|
|
1739
|
+
## Evidence-first completion
|
|
1740
|
+
|
|
1741
|
+
“Agent nói đã xong” không phải completion gate.
|
|
1742
|
+
|
|
1743
|
+
## Reversible optimization
|
|
1744
|
+
|
|
1745
|
+
Tối ưu output/context phải giữ đường lấy raw evidence trở lại.
|
|
1746
|
+
|
|
1747
|
+
## Benchmark-gated learning
|
|
1748
|
+
|
|
1749
|
+
Không promote rule/tool/provider chỉ vì cảm giác “có vẻ nhanh”.
|
|
804
1750
|
|
|
805
1751
|
---
|
|
806
1752
|
|
|
807
|
-
|
|
1753
|
+
# Giới hạn có chủ đích
|
|
808
1754
|
|
|
809
|
-
|
|
1755
|
+
UES cố ý **không**:
|
|
810
1756
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1757
|
+
- tạo hàng trăm agents;
|
|
1758
|
+
- load mọi skill cho mọi task;
|
|
1759
|
+
- auto push;
|
|
1760
|
+
- auto publish;
|
|
1761
|
+
- auto deploy;
|
|
1762
|
+
- ghi hidden chain-of-thought;
|
|
1763
|
+
- coi keyword routing là semantic truth tuyệt đối;
|
|
1764
|
+
- coi import scan là full compiler/LSP semantic graph;
|
|
1765
|
+
- coi một benchmark là bằng chứng model-equivalence;
|
|
1766
|
+
- bỏ verifier chỉ để tăng tốc;
|
|
1767
|
+
- dùng browser tool cho backend task không cần browser.
|
|
814
1768
|
|
|
815
|
-
|
|
1769
|
+
---
|
|
816
1770
|
|
|
817
|
-
|
|
818
|
-
npm install -g opencode-agent-skill
|
|
819
|
-
```
|
|
1771
|
+
# Quick start
|
|
820
1772
|
|
|
821
|
-
|
|
1773
|
+
~~~cmd
|
|
1774
|
+
npm install -g @earendil-works/pi-coding-agent
|
|
1775
|
+
pi install npm:opencode-agent-skill
|
|
1776
|
+
pi
|
|
1777
|
+
~~~
|
|
822
1778
|
|
|
823
|
-
|
|
824
|
-
13.0.0-beta.2
|
|
825
|
-
```
|
|
1779
|
+
Trong Pi:
|
|
826
1780
|
|
|
827
|
-
|
|
1781
|
+
~~~text
|
|
1782
|
+
/ues-run kiểm tra project, tìm lỗi, sửa lỗi cần thiết và chạy test xác minh
|
|
1783
|
+
~~~
|
|
828
1784
|
|
|
829
|
-
|
|
1785
|
+
Kiểm tra deterministic runtime:
|
|
830
1786
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
1787
|
+
~~~cmd
|
|
1788
|
+
ues task-policy "fix checkout bug" --json
|
|
1789
|
+
ues capability-fabric status .
|
|
1790
|
+
ues hierarchy "checkout inventory" .
|
|
1791
|
+
ues memory status .
|
|
1792
|
+
~~~
|
|
836
1793
|
|
|
837
|
-
|
|
1794
|
+
---
|
|
838
1795
|
|
|
839
|
-
|
|
840
|
-
npm view opencode-agent-skill@13.0.0-beta.2 version --registry=https://registry.npmjs.org/
|
|
841
|
-
```
|
|
1796
|
+
# Tài liệu sâu hơn
|
|
842
1797
|
|
|
843
|
-
|
|
1798
|
+
- <code>docs/ENGINEERING-DESIGN.md</code> — engineering architecture.
|
|
1799
|
+
- <code>docs/DETERMINISTIC-TOOLS.md</code> — deterministic CLI/evidence tools.
|
|
1800
|
+
- <code>docs/V11-PERCEPTION-ADAPTIVE-EXECUTION.md</code> — perception/adaptive execution.
|
|
1801
|
+
- <code>docs/V12-WEAK-MODEL-INTELLIGENCE.md</code> — weak-model intelligence.
|
|
1802
|
+
- <code>docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md</code> — parallel runtime.
|
|
1803
|
+
- <code>docs/V14-CONTEXT-MEMORY-FABRIC.md</code> — context, memory, capability fabric.
|
|
1804
|
+
- <code>docs/V14.1-QUALITY-PERFORMANCE-FABRIC.md</code> — quality-preserving performance.
|
|
1805
|
+
- <code>docs/EVALS.md</code> — evaluation.
|
|
1806
|
+
- <code>docs/PI-COMPAT.md</code> — Pi compatibility.
|
|
1807
|
+
- <code>docs/NPM-PUBLISH.md</code> — npm publishing.
|
|
844
1808
|
|
|
845
1809
|
---
|
|
846
1810
|
|
|
847
|
-
|
|
1811
|
+
# License
|
|
848
1812
|
|
|
849
|
-
MIT
|
|
1813
|
+
MIT
|