@ngockhoale/ukit 3.4.65 → 3.4.66
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 +8 -0
- package/manifests/documentation.yaml +11 -0
- package/package.json +2 -2
- package/scripts/release/verify-release.mjs +7 -0
- package/scripts/test/run-handoff-isolated.mjs +178 -0
- package/template_project/.claude/agents/code-reviewer.md +4 -1
- package/template_project/.claude/agents/handoff-planner.md +3 -0
- package/template_project/.claude/commands/ukit/handoff-clear.md +34 -35
- package/template_project/.claude/commands/ukit/handoff-create.md +40 -21
- package/template_project/.claude/commands/ukit/handoff-fullstack.md +141 -66
- package/template_project/.claude/commands/ukit/handoff-implement.md +27 -12
- package/template_project/.claude/commands/ukit/handoff-review.md +18 -8
- package/template_project/.claude/hooks/handoff-resume.sh +8 -0
- package/template_project/.claude/skills/advisor-plan/REFERENCE.md +33 -2
- package/template_project/.claude/skills/advisor-plan/SKILL.md +6 -4
- package/template_project/.claude/ukit/runtime/resumable-run.mjs +40 -7
- package/template_project/.claude/ukit/runtime/stop-coordinator.mjs +128 -44
- package/template_project/.claude/ukit/runtime/task-watchdog.mjs +1 -1
- package/template_project/.omp/agents/code-reviewer.md +4 -1
- package/template_project/.omp/agents/handoff-planner.md +3 -0
- package/template_project/AGENTS.md +2 -2
- package/template_project/CLAUDE.md +2 -2
- package/template_project/docs/AI_HANDOFF/RULES.md +24 -27
- package/template_project/docs/AI_HANDOFF/queued/README.md +52 -0
- package/template_project/instructions/core.md +2 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
- Do NOT read `RULES.md` every request — only when you need flow clarification.
|
|
8
8
|
- Do NOT read multiple task files in one request.
|
|
9
9
|
- If ACTIVE.md + INDEX.md + task file would exceed budget, read only the task file.
|
|
10
|
-
-
|
|
10
|
+
- If a state file exceeds the working context budget, read bounded sections and checkpoint/split work without discarding records. Context pressure never authorizes `clear handoff`, archive, or loss of requirements.
|
|
11
11
|
|
|
12
12
|
## How Human Submits Ideas
|
|
13
13
|
|
|
@@ -24,8 +24,9 @@ Mọi giao tiếp giữa các AI trong handoff CHỈ qua file dưới `docs/AI_H
|
|
|
24
24
|
- `INDEX.md` — bảng task + status (mọi phase đọc/ghi).
|
|
25
25
|
- `tasks/TASK-xxx.md` — nơi sống của từng task: Goal + Test Cases + Verification + Executor Report + Reviewer Verdict + **Discussion thread**.
|
|
26
26
|
- `ACTIVE.md` — snapshot cycle hiện tại.
|
|
27
|
-
- `RUN.md` — run cursor của `/ukit:handoff-fullstack`; `Phase:` ≠ `done`/`blocked` khiến Stop gate từ chối stop → run tự chạy tiếp.
|
|
28
|
-
- `
|
|
27
|
+
- `RUN.md` — run cursor của `/ukit:handoff-fullstack`; `Phase:` ≠ `done`/`blocked` với `Paused: no` và session thuộc ownership khiến Stop gate từ chối stop → run tự chạy tiếp. `Paused: yes` giải phóng continuation (stop được phép) nhưng không mint completion.
|
|
28
|
+
- `ARCHIVE/` — completed-only history; active scans exclude this and legacy lowercase `archive/`.
|
|
29
|
+
- `SOURCE.md` / `NOTES.md` / `LEDGER.md` — durable owner source, classified decisions/rationale and requirement coverage; `queued/` holds preserved plans, not permission to execute them.
|
|
29
30
|
|
|
30
31
|
**Cấm**: AI gửi câu hỏi/comment qua chat tool khác, qua commit message, hay qua file ngoài thư mục này. Lý do: cross-tool/cross-subagent chỉ đồng bộ được qua file. AI nào không đọc folder này = không tham gia handoff.
|
|
31
32
|
|
|
@@ -51,13 +52,13 @@ Từ sau đó, mọi ngã ba đều có cách giải quyết tự động:
|
|
|
51
52
|
| Tình huống | Xử lý tự động |
|
|
52
53
|
|-----------|---------------|
|
|
53
54
|
| Scope nhiều subsystem | tách module, plan module 1, queue phần còn lại vào `INDEX.md` |
|
|
54
|
-
| Plan review còn `Issues Found` sau 2 vòng |
|
|
55
|
+
| Plan review còn `Issues Found` sau 2 vòng | repair/replan rồi fresh independent escalation review; không tự Approved, affected tasks chưa ready |
|
|
55
56
|
| 2 task cùng wave đụng 1 file | đẩy task sau xuống wave kế (thêm dependency) |
|
|
56
|
-
| Working tree bẩn | commit checkpoint rồi chạy tiếp |
|
|
57
|
+
| Working tree bẩn | KHÔNG blanket-commit và KHÔNG unstage/revert thay đổi không thuộc run. Chỉ commit checkpoint cho file thuộc scope đang chạy; file không liên quan giữ nguyên, ghi vào RUN/Discussion, rồi chạy tiếp |
|
|
57
58
|
| Reviewer trả `changes_requested`/`critical_block` | vào vòng auto-fix, tối đa 2 vòng |
|
|
58
|
-
| Task vẫn fail sau 2 vòng fix |
|
|
59
|
+
| Task vẫn fail sau 2 vòng fix | đổi strategy, investigate/replan và tiếp tục independent tasks; local failure không phải external blocked |
|
|
59
60
|
|
|
60
|
-
Chỉ
|
|
61
|
+
Chỉ cần user-only action khi thật sự thiếu quyền/credential, service/network ngoài repo không hoạt động, hoặc requirement conflict thật cần owner quyết định. Test/lint/review/plan failures đi vào FIX (bounded strategies), không giả external blocker; vẫn hoàn tất independent in-scope work trước khi báo.
|
|
61
62
|
|
|
62
63
|
**Quality gate không bị nới.** Bỏ chỗ *hỏi người*, không bỏ chỗ *kiểm tra*: TDD RED→GREEN vẫn bắt buộc, reviewer vẫn phải khác model executor, vẫn re-run Verification Commands, vẫn cấm claim DONE khi chưa có PASS tươi.
|
|
63
64
|
|
|
@@ -74,7 +75,7 @@ Cursor: wave <N> batch <M> — <vừa xong cái gì>
|
|
|
74
75
|
Next: <bước kế tiếp chính xác>
|
|
75
76
|
```
|
|
76
77
|
|
|
77
|
-
`Phase:` khác `done` = có run đang dở. Command được gọi lại sẽ **chạy tiếp từ cursor**, không plan lại, không hỏi. Hook `SessionStart` (`handoff-resume.sh`)
|
|
78
|
+
`Phase:` khác `done` = có run đang dở. Command được gọi lại sẽ **chạy tiếp từ cursor**, không plan lại, không hỏi. Hook `SessionStart` (`handoff-resume.sh`) chỉ inject lệnh chạy tiếp khi `Phase:` ≠ `done`/`blocked`, `Paused: no` và session thuộc ownership (resume marker sau compact/resume, hoặc `/ukit:handoff-fullstack` tường minh). Session startup/clear mới chỉ nhận ghi chú, không bị inject. Compact giữa run không làm mất cursor vì RUN.md nằm trên đĩa.
|
|
78
79
|
|
|
79
80
|
### Context: không bao giờ dừng giữa nhiệm vụ
|
|
80
81
|
|
|
@@ -113,7 +114,7 @@ Mỗi tool/subagent đọc cùng `INDEX.md` + `tasks/TASK-xxx.md` → chọn tas
|
|
|
113
114
|
```
|
|
114
115
|
brainstorm ──[plan approved]──▶ ready ──[executor pick]──▶ in_progress
|
|
115
116
|
├─[PASS]──▶ pending_review
|
|
116
|
-
└─[FAIL]──▶ blocked
|
|
117
|
+
└─[FAIL]──▶ in_progress (fix/replan, tối đa 2 strategy; `blocked` chỉ cho external blocker hoặc requirement conflict cần owner)
|
|
117
118
|
pending_review ──[reviewer]──▶ approved | approved_minor ──▶ done
|
|
118
119
|
├▶ changes_requested ──[fix]──▶ in_progress
|
|
119
120
|
└▶ critical_block ──[fix]──▶ in_progress
|
|
@@ -136,13 +137,11 @@ chạy **đến khi không còn gì để làm**:
|
|
|
136
137
|
- Chỉ 2 output kết thúc hợp lệ: `HANDOFF FULLSTACK COMPLETE` hoặc
|
|
137
138
|
`HANDOFF FULLSTACK BLOCKED`. Recap/checkpoint không phải điểm dừng — dùng form
|
|
138
139
|
`CHECKPOINT — WORK CONTINUING` rồi làm tiếp ngay.
|
|
139
|
-
- Phase 0
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
(
|
|
144
|
-
- Stop gate (Claude Code): `RUN.md` `Phase:` ≠ `done`/`blocked` → Stop hook từ chối
|
|
145
|
-
stop kèm `Next:` step. Breaker `stopGateMaxStalledBlocks` (mặc định 12) thả ra nếu
|
|
140
|
+
- Phase 0 chỉ nhận unfinished work trong scope owner giao, ghi ScopePlans/ScopeQueue và Authorization vào RUN. Không tự nhập HISTORY/ARCHIVE, `docs/TASKS.md`, plan ngoài scope hay unrelated WIP. Late independent creates nằm ngoài frozen scope; repair/replan cần để hoàn tất scope vẫn tiếp tục.
|
|
141
|
+
- Quiet-period: chỉ đóng run khi **frozen scope** (ScopePlans/ScopeQueue trong RUN) rỗng + `handoff.fullstack.quietScansRequired`
|
|
142
|
+
(mặc định 2) scan liên tiếp trong scope đó không thấy việc mới. Lịch sử HISTORY/ARCHIVE và backlog ngoài scope không nằm trong quiet scan.
|
|
143
|
+
- Stop gate (Claude Code): `RUN.md` `Phase:` ≠ `done`/`blocked` với `Paused: no` và session thuộc ownership → Stop hook từ chối
|
|
144
|
+
stop kèm `Next:` step. `Paused: yes` cho phép stop (ghi lý do + recovery action), không phải completion. Breaker `stopGateMaxStalledBlocks` (mặc định 12) thả ra nếu
|
|
146
145
|
cursor không nhích — lối thoát, không phải đường thường.
|
|
147
146
|
- Gate theo session (`stopGateScope: session`, mặc định): chỉ ép session đã chạy `/ukit:handoff-fullstack`
|
|
148
147
|
hoặc nhận resume marker (compact/resume). Session mới (startup/clear) chỉ nhận ghi chú, không bị ép;
|
|
@@ -163,15 +162,14 @@ chạy **đến khi không còn gì để làm**:
|
|
|
163
162
|
`tasks/TASK-*.md` — kể cả khi mọi task canonical đang `ready` (luật "re-run allowed" không áp dụng).
|
|
164
163
|
Thay vào đó ghi plan mới vào **queued path** `docs/AI_HANDOFF/queued/<slug>/` (SPEC/PLAN/INDEX/HANDOFF
|
|
165
164
|
+ tasks/) như một blueprint ngủ đông, rồi báo đường dẫn. Chỉ khi human **tường minh** ra lệnh bỏ run
|
|
166
|
-
|
|
165
|
+
mới được thay scope; `/ukit:handoff-clear` chỉ pause và giữ unfinished records, không cấp quyền ghi đè canonical. Executor không
|
|
167
166
|
bao giờ được kích hoạt ở phase này; planner chỉ ghi dưới đúng một output root được chỉ định.
|
|
168
167
|
- **Không drop việc đã queue**: `/ukit:handoff-fullstack` P2 sweep các blueprint `queued/*/` — cycle mới
|
|
169
168
|
kéo chúng vào `tasks/TASK-xxx.md` như mọi việc khác, hoặc ghi rõ lý do out-of-scope trong `PLAN.md §1/§2`.
|
|
170
169
|
Resume (RUN.md đang sống) giữ nguyên blueprint cho cycle sau, không ghi đè.
|
|
171
|
-
- `handoff-clear`
|
|
172
|
-
chặn stop của session sau.
|
|
170
|
+
- `handoff-clear` khi còn việc mở đặt `Paused: yes`, giữ actual phase/scope và recovery action; pause giải phóng continuation nhưng không mint completion.
|
|
173
171
|
- Phase F: docs sync (WORKLOG luôn; PROJECT/CODE_MAP/CHANGELOG khi đổi surface) →
|
|
174
|
-
archive cycle vào `
|
|
172
|
+
chỉ archive completed cycle vào `ARCHIVE/cycle-NN/` (khi `autoArchive=true`, không còn review/integration/release debt) → `Phase: done` →
|
|
175
173
|
Final Report với marker.
|
|
176
174
|
|
|
177
175
|
### 4 Phases
|
|
@@ -236,13 +234,12 @@ Missing any → `needs_breakdown`, `blocked`, or `needs_human`.
|
|
|
236
234
|
|
|
237
235
|
## Clear Handoff
|
|
238
236
|
|
|
239
|
-
1.
|
|
240
|
-
2.
|
|
241
|
-
3.
|
|
242
|
-
4.
|
|
243
|
-
5.
|
|
244
|
-
6.
|
|
245
|
-
7. **`RUN.md` → `Phase: done` hoặc xóa** — bắt buộc, không thì Stop gate chặn session sau.
|
|
237
|
+
1. Clear là pause/cancel, không phải completion. Giữ nguyên unfinished work, source, decisions và evidence dưới `docs/AI_HANDOFF/`.
|
|
238
|
+
2. Khi còn pending/blocked/pending-review/pending-release hoặc integration chưa pass: giữ INDEX/tasks/PLAN/SPEC/LEDGER, đặt `Paused: yes` trong RUN và ghi lý do + next recovery action. Không giả `Phase: done` hay xóa cursor.
|
|
239
|
+
3. Chỉ cycle hoàn tất có independent review + verification + delivery evidence mới vào `ARCHIVE/cycle-NN/`. Move task records trước, chạy `archive-cycle` snapshot trước khi reset INDEX; kiểm tra snapshot và giữ đầy đủ source/requirements/reviews.
|
|
240
|
+
4. Không prune/delete lịch sử. Legacy `archive/` và `cycle-NNN.md` chỉ là provenance read-only; không tự chạy lại hay coi summary là completion proof.
|
|
241
|
+
5. Chỉ reset active templates sau khi completed archive được kiểm chứng; giữ mọi queued plan, amendment và record chưa nằm trong archive đó. Cleanup worktree dùng receipt gate, không force-remove.
|
|
242
|
+
6. Không unstage/revert unrelated owner changes. Verify mỗi state-file write trước khi báo kết quả.
|
|
246
243
|
|
|
247
244
|
## Docs Sync
|
|
248
245
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# docs/AI_HANDOFF/queued/ — queued blueprints
|
|
2
|
+
|
|
3
|
+
A queued blueprint is a plan written while a live run owns the canonical lane, or a plan
|
|
4
|
+
whose tasks exceed the 10-task active threshold. It is a draft: it carries no runnable
|
|
5
|
+
admission until `/ukit:handoff-fullstack` folds it into the canonical lane.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
queued/<slug>/
|
|
9
|
+
├── SPEC.md — spec of record for this blueprint
|
|
10
|
+
├── PLAN.md — plan with §1-§6 and the Planner Report footer
|
|
11
|
+
├── INDEX.md — draft index: rows are status=queued_blueprint, never ready
|
|
12
|
+
├── HANDOFF.md — activation notes (what it depends on, when to start) + queue header
|
|
13
|
+
└── tasks/ — TASK-<id>.md blueprints, Status: queued_blueprint
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`queued_blueprint` marks a spec-of-record, never a runnable task. The queued `INDEX.md` and
|
|
17
|
+
`tasks/` are not canonical admission; the canonical `docs/AI_HANDOFF/INDEX.md` and
|
|
18
|
+
`tasks/` are the only runnable lane.
|
|
19
|
+
|
|
20
|
+
## Mandatory overflow (consumable)
|
|
21
|
+
|
|
22
|
+
When `/ukit:handoff-create` plans more than 10 tasks, the overflow of `feasible`/`adapted`
|
|
23
|
+
LEDGER rows is queued here WITHOUT any `QueueIntent` / `Queue*` header line. It is consumable
|
|
24
|
+
work: `/ukit:handoff-fullstack` folds it into the cycle like any legacy blueprint.
|
|
25
|
+
|
|
26
|
+
## Deliberate-future queue (backlog)
|
|
27
|
+
|
|
28
|
+
A blueprint that is planned work for a LATER cycle — `deferred` LEDGER rows only — carries
|
|
29
|
+
these header lines at the top of its `HANDOFF.md`:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
QueueIntent: deliberate-future
|
|
33
|
+
QueueOrder: <int> # drain order, lowest first
|
|
34
|
+
QueueDrain: separate-backlog
|
|
35
|
+
QueueSource: <R-IDs/epics> # ledger rows / epics this blueprint covers
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Semantics:
|
|
39
|
+
|
|
40
|
+
- `/ukit:handoff-fullstack` does **not** fold these blueprints into the current cycle.
|
|
41
|
+
It reports each one as `Backlog: <slug>` and leaves it untouched; Backlog items never
|
|
42
|
+
count toward `index:all-done` / `ExitPredicate`.
|
|
43
|
+
- An explicit slug in the invocation overrides this: the named blueprint is drained,
|
|
44
|
+
one blueprint per invocation.
|
|
45
|
+
- No new INDEX status exists for this. The metadata lives in the blueprint header only;
|
|
46
|
+
the status vocabulary in `RULES.md` is unchanged.
|
|
47
|
+
- Blueprints WITHOUT `QueueIntent` keep the legacy fold-in behaviour.
|
|
48
|
+
|
|
49
|
+
## Naming
|
|
50
|
+
|
|
51
|
+
Use a unique `<slug>`. If `queued/<slug>/` already exists, append `-2`, `-3`, … and never
|
|
52
|
+
overwrite an existing blueprint.
|
|
@@ -107,7 +107,7 @@ Chỉ active khi task đi qua `docs/AI_HANDOFF/` ("execute task TASK-xxx" hoặc
|
|
|
107
107
|
<!-- RULE: UNATTENDED-02 -->
|
|
108
108
|
- `maxAttemptsPerFailure: 2`, `maxRecoveryStrategies: 2` distinct fix strategies before reassessing — retry the same edit, then fix the cause differently; never loop one strategy.
|
|
109
109
|
<!-- RULE: UNATTENDED-03 -->
|
|
110
|
-
- BLOCKED only on true external blockers: missing credentials, dead service, unreachable network/API. Test failures, lint errors, review findings, ambiguity are NOT blockers — feed FIX.
|
|
110
|
+
- BLOCKED only on true external blockers: missing credentials/permissions, dead service, unreachable network/API, or a genuine requirement conflict that needs an owner decision. Test failures, lint errors, review findings, plan findings, ambiguity within scope are NOT blockers — feed FIX (bounded strategies, then investigate/replan) and continue independent scope tasks.
|
|
111
111
|
<!-- RULE: UNATTENDED-04 -->
|
|
112
112
|
- A deny (hook/gate/permission) never becomes a question: pick the next safer alternative satisfying the intent, record the substitution. Never emit "do you want me to…" — decide and proceed.
|
|
113
113
|
|
|
@@ -141,7 +141,7 @@ DuraOne skill chỉ active khi pack `duraone` được cài hoặc `.claude/skil
|
|
|
141
141
|
|
|
142
142
|
## Handoff Fullstack Rules
|
|
143
143
|
<!-- RULE: HAND-02 -->
|
|
144
|
-
- `docs/AI_HANDOFF/RUN.md` là run cursor có thẩm quyền; `Phase:` ≠ `done`/`blocked` = run còn sống — Stop gate từ chối stop, trả về `Next:`. Chỉ `HANDOFF FULLSTACK COMPLETE`/`BLOCKED` kết thúc run — recap/checkpoint không phải completion; resume tự
|
|
144
|
+
- `docs/AI_HANDOFF/RUN.md` là run cursor có thẩm quyền; `Phase:` ≠ `done`/`blocked` = run còn sống — Stop gate từ chối stop, trả về `Next:`. Chỉ `HANDOFF FULLSTACK COMPLETE`/`BLOCKED` kết thúc run — recap/checkpoint không phải completion; resume chỉ tiếp tục frozen scope khi `Paused: no` và session thuộc ownership (resume marker hoặc `/ukit:handoff-fullstack` tường minh), không tự inject ở startup/clear mới. Kết thúc cycle: docs sync → archive completed-only `ARCHIVE/cycle-NN/` → `Phase: done`; `handoff-clear` khi còn việc mở đặt `Paused: yes` (giữ phase/scope/recovery, không mint completion, không xóa cursor). Full rules: `docs/AI_HANDOFF/RULES.md`.
|
|
145
145
|
|
|
146
146
|
## Compact Instructions
|
|
147
147
|
Compact giữa handoff run: giữ goal, RUN.md path + phase, task inventory + task đang làm, `Next:` step, blockers, verification evidence, commits, worktree/copy-back state, "compact không phải completion". Sau compact: đọc lại RUN.md + INDEX.md rồi chạy `Next:`.
|