@ngockhoale/ukit 1.2.1 → 1.3.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/CHANGELOG.md +27 -1
- package/README.md +7 -5
- package/manifests/platform.full.yaml +127 -13
- package/package.json +1 -1
- package/src/core/runInstallPipeline.js +6 -1
- package/src/core/runtimeConfig.js +29 -112
- package/src/index/impactCatalog.js +12 -0
- package/src/index/taskRouting.js +3 -0
- package/templates/.claude/agents/ukit-small-task-maintainer.md +5 -5
- package/templates/.claude/hooks/post-edit-verify.sh +13 -0
- package/templates/.claude/hooks/pre-edit-backup.sh +13 -0
- package/templates/.claude/hooks/stale-spec-guard.sh +13 -0
- package/templates/.claude/settings.json +20 -0
- package/templates/.claude/ukit/index/anchor-search.mjs +99 -0
- package/templates/.claude/ukit/index/lib/index-core.mjs +3 -0
- package/templates/.claude/ukit/index/post-edit-verify.mjs +206 -0
- package/templates/.claude/ukit/index/pre-edit-backup.mjs +84 -0
- package/templates/.claude/ukit/index/route-task.mjs +6 -0
- package/templates/.claude/ukit/index/safe-patch.mjs +97 -0
- package/templates/.claude/ukit/index/stale-spec-check.mjs +192 -0
- package/templates/.claude/ukit/runtime/safe-patch-core.mjs +140 -0
- package/templates/.claude/ukit/runtime/text-profile.mjs +139 -0
- package/templates/.codex/README.md +4 -3
- package/templates/.codex/settings.json +10 -11
- package/templates/.gitignore +0 -1
- package/templates/AGENTS.md +11 -4
- package/templates/CLAUDE.md +12 -4
- package/templates/ukit/README.md +1 -1
- package/templates/ukit/storage/config.json +153 -4
- package/templates/.claude/ukit/.env.example +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.3.0",
|
|
3
3
|
"agent": "claude-code",
|
|
4
4
|
"compact": {
|
|
5
5
|
"enabled": true,
|
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
"codexContext": {
|
|
10
10
|
"enabled": true,
|
|
11
11
|
"autoCompact": true,
|
|
12
|
-
"budgetTokens":
|
|
12
|
+
"budgetTokens": 100000,
|
|
13
13
|
"compactTarget": 150,
|
|
14
14
|
"compactTargetUnit": "lines",
|
|
15
|
-
"decisionModelEnv": "UKIT_SMALL_TASK_MODEL",
|
|
16
15
|
"decisionAgent": "ukit-small-task-maintainer",
|
|
17
16
|
"mode": "soft-handoff",
|
|
18
17
|
"preserve": [
|
|
@@ -32,7 +31,6 @@
|
|
|
32
31
|
},
|
|
33
32
|
"agentContext": {
|
|
34
33
|
"enabled": true,
|
|
35
|
-
"decisionModelEnv": "UKIT_SMALL_TASK_MODEL",
|
|
36
34
|
"decisionAgent": "ukit-small-task-maintainer",
|
|
37
35
|
"executionMode": "sidecar-parallel",
|
|
38
36
|
"mustNotBlockMainTask": true,
|
|
@@ -88,6 +86,17 @@
|
|
|
88
86
|
"maxRetries": 1,
|
|
89
87
|
"confidenceThreshold": 50
|
|
90
88
|
},
|
|
89
|
+
"safePatch": {
|
|
90
|
+
"enabled": true,
|
|
91
|
+
"strictSharedRisk": true,
|
|
92
|
+
"largeFileLineThreshold": 800,
|
|
93
|
+
"largeFileByteThreshold": 200000,
|
|
94
|
+
"backupEnabled": true,
|
|
95
|
+
"backupRetentionDays": 30,
|
|
96
|
+
"deltaMaxChangedLines": 120,
|
|
97
|
+
"deltaMaxHunks": 3,
|
|
98
|
+
"deltaMaxDiffCells": 2000000
|
|
99
|
+
},
|
|
91
100
|
"subagents": {
|
|
92
101
|
"enabled": true,
|
|
93
102
|
"smallTaskModel": "unic-lite",
|
|
@@ -147,5 +156,145 @@
|
|
|
147
156
|
"mustNotBlockMainTask": true,
|
|
148
157
|
"maxSidecarWaitMs": 0
|
|
149
158
|
}
|
|
159
|
+
},
|
|
160
|
+
"_help": {
|
|
161
|
+
"README": {
|
|
162
|
+
"muc_dich": "Đây là file cấu hình runtime duy nhất của UKit, khi install sẽ nằm ở .ukit/storage/config.json. Không dùng .env để chỉnh UKit nữa.",
|
|
163
|
+
"ai_nen_sua": "Người dùng bình thường vẫn chỉ cần nhớ `ukit install`. Maintainer hoặc power user mới cần sửa file JSON này để chỉnh cách UKit tự điều phối AI.",
|
|
164
|
+
"cach_sua": "Chỉ sửa value, không đổi tên key. Đây là JSON chuẩn: string phải dùng dấu nháy kép, có dấu phẩy giữa các field, không dùng // comment.",
|
|
165
|
+
"nguyen_tac_chat_luong": "Luôn theo UKit CoDev: chất lượng > an toàn > tốc độ > tiết kiệm token. Không chỉnh cho nhanh nếu làm AI trả lời kém hơn.",
|
|
166
|
+
"sau_khi_sua": "Sau khi sửa file này, nên mở session AI mới. Nếu muốn refresh template trong repo thì chạy lại `ukit install`."
|
|
167
|
+
},
|
|
168
|
+
"cac_chinh_sua_thuong_gap": {
|
|
169
|
+
"doi_model_noi_bo": {
|
|
170
|
+
"field": "subagents.smallTaskModel",
|
|
171
|
+
"mac_dinh": "unic-lite",
|
|
172
|
+
"y_nghia": "Model nội bộ chạy sidecar cho các quyết định nhỏ/an toàn của UKit. Không thay thế model chính đang làm task của user.",
|
|
173
|
+
"vi_du": "Đổi subagents.smallTaskModel sang tên model khác nếu unic-lite không dùng được hoặc bạn muốn model nội bộ khác."
|
|
174
|
+
},
|
|
175
|
+
"compact_codex_khi_gan_150k_token": {
|
|
176
|
+
"field": "compact.codexContext.budgetTokens",
|
|
177
|
+
"mac_dinh": 100000,
|
|
178
|
+
"co_the_tang_len": 150000,
|
|
179
|
+
"khuyen_nghi": "100000 là mức cân bằng: đủ context cho chất lượng nhưng tránh để phiên chạy tới 150k-180k token dễ gặp lỗi connection/capacity.",
|
|
180
|
+
"y_nghia": "Ngưỡng token context của Codex Desktop trước khi UKit chuẩn bị compact/handoff. Ví dụ 100000 nghĩa là gần 100k token thì compact."
|
|
181
|
+
},
|
|
182
|
+
"doi_do_dai_ban_tom_tat_codex": {
|
|
183
|
+
"field": "compact.codexContext.compactTarget",
|
|
184
|
+
"mac_dinh": 150,
|
|
185
|
+
"khoang_goi_y": [
|
|
186
|
+
120,
|
|
187
|
+
170
|
|
188
|
+
],
|
|
189
|
+
"y_nghia": "Độ dài bản handoff sau compact, tính bằng dòng, không phải token. Không set 150000 ở đây."
|
|
190
|
+
},
|
|
191
|
+
"tat_auto_compact_codex": {
|
|
192
|
+
"field": "compact.codexContext.autoCompact",
|
|
193
|
+
"mac_dinh": true,
|
|
194
|
+
"y_nghia": "Chỉ set false khi đang debug hành vi compact của UKit."
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"version": "Phiên bản config runtime đi kèm package UKit.",
|
|
198
|
+
"agent": "Adapter mặc định của workspace. Thường giữ nguyên theo lúc install.",
|
|
199
|
+
"compact": {
|
|
200
|
+
"enabled": "Bật/tắt toàn bộ helper compact của UKit.",
|
|
201
|
+
"tokenThreshold": "Ngưỡng token chung cho runtime compact dùng chung.",
|
|
202
|
+
"contextRotDetection": "Phát hiện context quá dài/dễ mục để giữ lại state quan trọng trước khi AI nhớ sai.",
|
|
203
|
+
"askBeforeDrop": "Giữ thái độ thận trọng trước khi bỏ context quan trọng. Nếu rủi ro thì hand back cho main model.",
|
|
204
|
+
"agentContext": {
|
|
205
|
+
"enabled": "Bật policy compact context theo từng agent.",
|
|
206
|
+
"decisionAgent": "Agent nội bộ hỗ trợ quyết định compact/handoff trong trường hợp an toàn.",
|
|
207
|
+
"executionMode": "sidecar-parallel nghĩa là lane quyết định compact chạy song song với task chính.",
|
|
208
|
+
"mustNotBlockMainTask": "Nếu true, sidecar nội bộ không được dừng/thay thế/làm chậm task chính của user.",
|
|
209
|
+
"targets": {
|
|
210
|
+
"claude": {
|
|
211
|
+
"autoCompact": "Giữ compact lane của Claude bật.",
|
|
212
|
+
"mode": "precompact-reinject nghĩa là Claude được bơm context quan trọng trước/sau compact.",
|
|
213
|
+
"preserveExistingHooks": "Nên giữ true để không gỡ PreCompact/reinject của Claude."
|
|
214
|
+
},
|
|
215
|
+
"opencode": {
|
|
216
|
+
"autoCompact": "Giữ compact lane của OpenCode bật.",
|
|
217
|
+
"mode": "native-auto-prune nghĩa là OpenCode dùng compaction.auto/prune native.",
|
|
218
|
+
"preserveExistingCompaction": "Nên giữ true để không gỡ compact native của OpenCode."
|
|
219
|
+
},
|
|
220
|
+
"codex": {
|
|
221
|
+
"autoCompact": "Bật policy soft handoff compact cho Codex Desktop.",
|
|
222
|
+
"mode": "soft-handoff nghĩa là UKit tạo/dùng state tóm tắt, không can thiệp trực tiếp vào internals của app Codex.",
|
|
223
|
+
"compactTarget": "Độ dài bản handoff sau compact, tính bằng dòng.",
|
|
224
|
+
"compactTargetUnit": "Đơn vị của compactTarget. Nên giữ là lines.",
|
|
225
|
+
"compactTargetRecommendedRange": "Khoảng số dòng khuyến nghị cho bản handoff.",
|
|
226
|
+
"compactTargetMax": "Số dòng tối đa cho bản handoff, tránh lỡ tay set quá dài."
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"codexContext": {
|
|
231
|
+
"enabled": "Bật policy soft context handoff cho Codex Desktop.",
|
|
232
|
+
"autoCompact": "Cho phép UKit tự quyết định compact/handoff khi context Codex dài.",
|
|
233
|
+
"budgetTokens": "Ngưỡng token context của Codex Desktop trước khi compact. Mặc định 100000 để cân bằng chất lượng và giảm lỗi capacity/connection. Có thể tăng 150000 nếu cần, nhưng không nên để quá dài.",
|
|
234
|
+
"compactTarget": "Độ dài bản handoff sau compact, tính bằng dòng, không phải token. Mặc định 150; nên 120-150; tối đa 170.",
|
|
235
|
+
"compactTargetUnit": "Đơn vị của compactTarget. Nên giữ là lines.",
|
|
236
|
+
"compactTargetRecommendedRange": "Khoảng số dòng khuyến nghị. Nên ở trong khoảng này nếu không có lý do đặc biệt.",
|
|
237
|
+
"compactTargetMax": "Số dòng tối đa cho bản handoff. Chặn trường hợp lỡ set 150000 dòng.",
|
|
238
|
+
"decisionAgent": "Agent nội bộ dùng cho quyết định compact an toàn.",
|
|
239
|
+
"mode": "soft-handoff nghĩa là UKit tóm tắt state để tiếp tục thay vì replay toàn bộ transcript.",
|
|
240
|
+
"preserve": "Những thứ bắt buộc phải giữ khi compact: mục tiêu, rule, file đang làm, quyết định, lỗi chưa xử lý, bằng chứng verify, bước tiếp theo."
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"tokenPipeline": {
|
|
244
|
+
"inputCompression": "Nén/tái sử dụng input context khi an toàn.",
|
|
245
|
+
"outputCompression": "Tóm tắt output command ồn nhưng vẫn giữ recovery hint.",
|
|
246
|
+
"promptCache": "Dùng cache prompt/context compact để giảm lặp lại."
|
|
247
|
+
},
|
|
248
|
+
"router": {
|
|
249
|
+
"enabled": "Bật task routing nội bộ.",
|
|
250
|
+
"defaultModel": "Model hint cân bằng cho công việc bình thường. Adapter/provider có thể map khác.",
|
|
251
|
+
"advisorModel": "Model hint mạnh hơn cho planning/reasoning khó khi được bật.",
|
|
252
|
+
"advisorEnabled": "Cho phép advisor-style planning cho task phức tạp.",
|
|
253
|
+
"maxAdvisorCalls": "Giới hạn số lần gọi advisor để không lãng phí."
|
|
254
|
+
},
|
|
255
|
+
"memory": {
|
|
256
|
+
"enabled": "Bật memory local của UKit.",
|
|
257
|
+
"autoCapture": "Cho phép UKit lưu decision/rule bền vững khi an toàn.",
|
|
258
|
+
"progressiveRetrieval": "Lấy memory liên quan nhỏ trước, chỉ mở rộng khi cần.",
|
|
259
|
+
"maxInjectionTokens": "Số token memory tối đa được inject vào context.",
|
|
260
|
+
"archiveAfterDays": "Sau bao nhiêu ngày memory có thể được archive/compact.",
|
|
261
|
+
"maxSessions": "Số session memory gần đây giữ active.",
|
|
262
|
+
"redactSecrets": "Cố tránh lưu secret vào memory."
|
|
263
|
+
},
|
|
264
|
+
"validation": {
|
|
265
|
+
"enabled": "Bật kiểm tra output nhẹ.",
|
|
266
|
+
"autoRetry": "Cho phép retry an toàn một lần khi validation thấy lỗi rõ.",
|
|
267
|
+
"maxRetries": "Số lần retry tối đa.",
|
|
268
|
+
"confidenceThreshold": "Ngưỡng confidence tối thiểu trước khi báo thận trọng."
|
|
269
|
+
},
|
|
270
|
+
"subagents": {
|
|
271
|
+
"enabled": "Cho phép UKit dùng các lane subagent nội bộ khi hữu ích.",
|
|
272
|
+
"smallTaskModel": "Model sidecar nội bộ cho quyết định nhỏ/an toàn của UKit. Đổi key này nếu muốn đổi model nội bộ.",
|
|
273
|
+
"smallTaskAgent": "Tên agent nội bộ phụ trách quyết định nhỏ không block task chính.",
|
|
274
|
+
"smallTaskUseCases": "Các loại việc an toàn sidecar có thể xử lý: dọn task, compact decision, phân loại, triage, queue maintenance, workspace maintenance.",
|
|
275
|
+
"keepMainModelFor": "Các việc rủi ro phải giữ ở main model: security, code risky, release, data-loss, architecture, deep reasoning.",
|
|
276
|
+
"decisionPolicy": {
|
|
277
|
+
"nonBlocking": "Sidecar nội bộ không được block task chính của user.",
|
|
278
|
+
"endUserInvisible": "Không biến orchestration nội bộ thành thứ end user phải học.",
|
|
279
|
+
"handBackOnRisk": "Nếu sidecar thấy rủi ro thì trả lại main model quyết định.",
|
|
280
|
+
"executionMode": "sidecar-parallel nghĩa là việc nội bộ có thể chạy riêng/song song với task chính.",
|
|
281
|
+
"mustNotBlockMainTask": "True nghĩa là sidecar không được dừng/thay thế/làm chậm task chính.",
|
|
282
|
+
"maxSidecarWaitMs": "0 nghĩa là không chờ sidecar trước khi tiếp tục task chính.",
|
|
283
|
+
"optimizeOrder": "Thứ tự ưu tiên khi ra quyết định nội bộ.",
|
|
284
|
+
"decisions": "Nhóm quyết định sidecar được phép hỗ trợ.",
|
|
285
|
+
"stepBudgets": "Gợi ý số bước planning tối đa theo độ lớn task trước khi reassess."
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"safePatch": {
|
|
289
|
+
"enabled": "Bật Safe Patch Protocol: UKit âm thầm chặn patch stale/ambiguous trên file rủi ro và giữ an toàn encoding khi helper nội bộ sửa file.",
|
|
290
|
+
"strictSharedRisk": "Nếu true, file runtime/shared-risk như .claude/hooks hoặc .claude/ukit sẽ bị guard chặt hơn; người dùng vẫn không cần nhớ command mới.",
|
|
291
|
+
"largeFileLineThreshold": "Số dòng từ đó file được xem là lớn và cần anchor/spec guard kỹ hơn.",
|
|
292
|
+
"largeFileByteThreshold": "Kích thước byte từ đó file được xem là lớn/rủi ro khi agent edit.",
|
|
293
|
+
"backupEnabled": "Nếu true, UKit tạo rollback bytes dưới .ukit/storage/backups cho edit rủi ro.",
|
|
294
|
+
"backupRetentionDays": "Số ngày giữ backup rollback cũ trong .ukit/storage/backups; UKit chỉ tự xoá folder backup có tên ngày hợp lệ YYYY-MM-DD.",
|
|
295
|
+
"deltaMaxChangedLines": "Ngân sách dòng đổi mặc định cho kiểm tra delta sau này.",
|
|
296
|
+
"deltaMaxHunks": "Ngân sách hunk đổi mặc định cho kiểm tra delta sau này.",
|
|
297
|
+
"deltaMaxDiffCells": "Giới hạn cell LCS khi tính delta; quá ngưỡng này UKit dùng fallback tuyến tính để tránh chậm trên file rất lớn."
|
|
298
|
+
}
|
|
150
299
|
}
|
|
151
300
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# UKit optional local runtime overrides.
|
|
2
|
-
# Copy to .claude/ukit/.env only if you need machine-local overrides.
|
|
3
|
-
# This is internal orchestration config; normal teammates still only need `ukit install`.
|
|
4
|
-
|
|
5
|
-
# Lightweight model for the internal UKit small-task maintainer subagent.
|
|
6
|
-
# Used for safe UKit decisions such as task cleanup, compact decisions,
|
|
7
|
-
# doc summarization, classification, auto-triage, and queue maintenance.
|
|
8
|
-
# It follows UKit CoDev principles: quality > speed > token savings.
|
|
9
|
-
# Risky/shared/security/release/data-loss/architecture work must keep the main model.
|
|
10
|
-
UKIT_SMALL_TASK_MODEL=unic-lite
|
|
11
|
-
|
|
12
|
-
# Codex Desktop soft auto-compact handoff budget.
|
|
13
|
-
# Target is compact handoff length (lines), not full app context tokens.
|
|
14
|
-
# 120-150 is preferred; 170 lines is the hard max for this lane.
|
|
15
|
-
UKIT_CODEX_AUTO_COMPACT=true
|
|
16
|
-
UKIT_CODEX_CONTEXT_BUDGET=60000
|
|
17
|
-
UKIT_CODEX_COMPACT_TARGET=150
|