@ngockhoale/ukit 2.5.0 → 2.6.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.
@@ -0,0 +1,98 @@
1
+ # SPEC — <feature / cycle goal>
2
+
3
+ <!--
4
+ Written by the planner at handoff-create (Step 2, before PLAN.md tasks).
5
+ Rule: cụ thể đến mức executor implement KHÔNG cần đoán — exact paths, module names,
6
+ API methods, statuses, schemas, validation rules, permissions, empty/error states,
7
+ migration behavior, test expectations. Section nào không áp dụng thì ghi "N/A — <lý do>",
8
+ không xóa heading. Open question nào cũng phải chốt 1 default và ghi vào §14.
9
+ -->
10
+
11
+ ## 1. Problem and context
12
+
13
+ <Vấn đề, hiện trạng code/docs liên quan, tại sao cần làm ngay.>
14
+
15
+ ## 2. Goals
16
+
17
+ - <Kết quả đo được — thành công trông như thế nào.>
18
+
19
+ ## 3. Non-goals
20
+
21
+ - <Cái CỤ THỂ không làm trong cycle này — chặn scope creep.>
22
+
23
+ ## 4. User journeys
24
+
25
+ - <Ai dùng, flow từng bước, kể cả unhappy path.>
26
+
27
+ ## 5. Functional requirements
28
+
29
+ - FR-001: <requirement>
30
+ - Given: <pre-state>
31
+ - When: <action>
32
+ - Then: <observable result>
33
+ - Error cases: <invalid input → exact behavior/message>
34
+
35
+ ## 6. Fullstack scope
36
+
37
+ ### Backend
38
+ <modules, functions, services — exact paths>
39
+ ### Database / schema / migrations
40
+ <schema changes, migration file names, backfill behavior>
41
+ ### API contract
42
+ <methods, routes, request/response shapes, status codes>
43
+ ### Frontend UI and state
44
+ <components, states, empty/error/loading>
45
+ ### Integration
46
+ <điểm nối giữa các layer>
47
+ ### Security and permissions
48
+ <ai được làm gì, validation/authz checks>
49
+ ### Performance
50
+ <budgets, query concerns, payload sizes>
51
+ ### Observability / logging
52
+ <log points, metrics, error surfacing>
53
+ ### Deployment and rollback
54
+ <feature flags, rollback path, ordering>
55
+
56
+ ## 7. Data model
57
+
58
+ <entities, fields, types, invariants, indexes>
59
+
60
+ ## 8. API contract
61
+
62
+ <endpoint table: method, path, request schema, response schema, error codes>
63
+
64
+ ## 9. UI behavior
65
+
66
+ <state machine per screen: loading / empty / error / success; copy nếu user-facing>
67
+
68
+ ## 10. Edge cases
69
+
70
+ - <concurrency, retries, offline, partial failure, large input, unicode, etc.>
71
+
72
+ ## 11. Test matrix
73
+
74
+ | Area | Cases | Test file |
75
+ |------|-------|-----------|
76
+ | <unit> | <happy + edge list> | <tests/...> |
77
+
78
+ ## 12. Acceptance criteria
79
+
80
+ - [ ] <verifiable criterion — ideally a command or observable state>
81
+
82
+ ## 13. Migration / upgrade steps
83
+
84
+ <ordered steps for existing installs; nếu không có ghi N/A>
85
+
86
+ ## 14. Open questions and chosen defaults
87
+
88
+ | Question | Chosen default | Rationale |
89
+ |----------|----------------|-----------|
90
+ | <q> | <default đã chọn> | <why> |
91
+
92
+ ## 15. Review checklist
93
+
94
+ - [ ] Mọi FR testable (có Given/When/Then hoặc command).
95
+ - [ ] Mọi layer fullstack được cover hoặc ghi N/A có lý do.
96
+ - [ ] Không còn instruction mơ hồ ("improve", "better UX" không định nghĩa).
97
+ - [ ] Dependencies giữa các phần đã ghi rõ.
98
+ - [ ] Legacy/unfinished work từ Phase 0 sweep đã được tính vào.
@@ -6,11 +6,14 @@ File này BẮT BUỘC giữ structure: Goal + Test Cases + Test Files + Verific
6
6
  Mọi AI (planner / executor / reviewer) đọc và ghi vào file NÀY. Không trao đổi ngoài file.
7
7
  -->
8
8
 
9
- - Status: `ready` <!-- ready | in_progress | pending_review | changes_requested | critical_block | approved | approved_minor | blocked | done -->
9
+ - Status: `ready` <!-- ready | in_progress | pending_review | changes_requested | critical_block | approved | approved_minor | blocked | done | cancelled_superseded -->
10
10
  - Size: `M` <!-- S | M | L — runtime budgets key off this field; defaults to M when missing -->
11
11
  - Owner: `-` <!-- tool đang giữ task -->
12
12
  - Reviewer: `-` <!-- model name reviewer dùng, set ở Phase 4 -->
13
13
  - Parent plan: `docs/AI_HANDOFF/PLAN.md` §<section>
14
+ - Spec references: `docs/AI_HANDOFF/SPEC.md` §<n>, §<n> <!-- FR/section IDs this task implements -->
15
+ - Supersedes: `(none)` <!-- hoặc TASK-xxx — recovery task (-R<n>) thay thế một record kẹt -->
16
+ - Superseded by: `(none)` <!-- set khi status = cancelled_superseded -->
14
17
 
15
18
  ## Goal
16
19
 
@@ -144,9 +144,18 @@
144
144
  }
145
145
  },
146
146
  "modelTiers": {
147
- "lite": { "claudeModel": "claude-haiku-4-5", "genericModel": "unic-lite" },
148
- "code": { "claudeModel": "claude-sonnet-5", "genericModel": "unic-code" },
149
- "smart": { "claudeModel": "claude-opus-5", "genericModel": "unic-smart" },
147
+ "lite": {
148
+ "claudeModel": "claude-haiku-4-5",
149
+ "genericModel": "unic-lite"
150
+ },
151
+ "code": {
152
+ "claudeModel": "claude-sonnet-5",
153
+ "genericModel": "unic-code"
154
+ },
155
+ "smart": {
156
+ "claudeModel": "claude-opus-5",
157
+ "genericModel": "unic-smart"
158
+ },
150
159
  "vision": {
151
160
  "claudeModel": "unic-vision",
152
161
  "genericModel": "unic-vision",
@@ -158,7 +167,11 @@
158
167
  "escalation": {
159
168
  "enabled": true,
160
169
  "debugLoopThreshold": 2,
161
- "tierOrder": ["lite", "code", "smart"],
170
+ "tierOrder": [
171
+ "lite",
172
+ "code",
173
+ "smart"
174
+ ],
162
175
  "cap": "smart"
163
176
  }
164
177
  },
@@ -242,12 +255,29 @@
242
255
  "done"
243
256
  ],
244
257
  "taskBudgets": {
245
- "S": { "softMin": 8, "hardMin": 15 },
246
- "M": { "softMin": 15, "hardMin": 30 },
247
- "L": { "softMin": 25, "hardMin": 45 },
258
+ "S": {
259
+ "softMin": 8,
260
+ "hardMin": 15
261
+ },
262
+ "M": {
263
+ "softMin": 15,
264
+ "hardMin": 30
265
+ },
266
+ "L": {
267
+ "softMin": 25,
268
+ "hardMin": 45
269
+ },
248
270
  "hardPolicy": "split"
249
271
  },
250
- "milestoneIntervalMin": 5
272
+ "milestoneIntervalMin": 5,
273
+ "fullstack": {
274
+ "stopGateEnabled": true,
275
+ "stopGateMaxStalledBlocks": 12,
276
+ "quietScansRequired": 2,
277
+ "idleWatchdogMin": 5,
278
+ "autoArchive": true,
279
+ "specRequired": true
280
+ }
251
281
  },
252
282
  "subagents": {
253
283
  "enabled": true,
@@ -545,7 +575,15 @@
545
575
  "rerunVerificationCommands": "Reviewer phải tự chạy lại Verification Commands, không tin output executor.",
546
576
  "appendVerdictToTaskFile": "Reviewer append `## Reviewer Verdict` vào task file để khép vòng handoff."
547
577
  },
548
- "statusFlow": "Danh sách status hợp lệ trong INDEX.md. Đổi tên trong này = đổi state machine handoff."
578
+ "statusFlow": "Danh sách status hợp lệ trong INDEX.md. Đổi tên trong này = đổi state machine handoff.",
579
+ "fullstack": {
580
+ "stopGateEnabled": "Bật Stop gate handoff: RUN.md Phase != done/blocked → Stop hook từ chối stop kèm Next step, giữ handoff-fullstack chạy tiếp thay vì đứng sau recap. Tắt chỉ khi debug.",
581
+ "stopGateMaxStalledBlocks": "Liveness breaker: cursor không nhích qua N lần block liên tiếp thì gate thả stop (tránh vòng lặp vô tận). Mặc định 12.",
582
+ "quietScansRequired": "Số scan liên tiếp không thấy việc mới trước khi handoff-fullstack được phép đóng run. Mặc định 2.",
583
+ "idleWatchdogMin": "Khoảng phút cho scheduled wakeup nếu harness hỗ trợ (cron/loop). Mặc định 5.",
584
+ "autoArchive": "true = Phase F tự archive cycle vào docs/AI_HANDOFF/archive/cycle-NN/ khi hoàn tất.",
585
+ "specRequired": "true = handoff-create bắt buộc viết docs/AI_HANDOFF/SPEC.md chi tiết trước khi tạo task."
586
+ }
549
587
  }
550
588
  }
551
589
  }