opencode-agent-skill 12.0.0-beta.0 → 13.0.0-beta.1

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 CHANGED
@@ -6,6 +6,54 @@ The project follows Semantic Versioning.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Fixed
10
+ - Routed all 11 `/ues-*` commands through the stable V2 `session.prompt` path using router-managed prompt aliases, avoiding `UnsupportedContentType` failures from the native `session.command` transport while preserving the same command templates and V1 native-command behavior.
11
+ - Prevented `/ues-run` from duplicating the full `$ARGUMENTS` payload inside its task-policy example, reducing long-prompt amplification.
12
+ - Fixed OpenCode V2 local router loading on clean global configs by removing the unnecessary bare `@opencode/plugin` runtime import; `ues-router` now exports the plain `{ id, setup }` definition accepted by the V2 loader.
13
+ - Prevented OpenCode V2 UES router subprocesses (`where`, `ocskill`, Node shim execution and Git probes) from flashing transient CMD windows on Windows by routing them through a hidden-window spawn wrapper.
14
+
15
+ ## [13.0.0-beta.1] - 2026-09-23
16
+
17
+ ### Fixed
18
+ - Hardened V2 prompt aliases for ChatGPT-style pasted prompts: BOM/zero-width prefixes and whole-prompt markdown fences are normalized before alias detection.
19
+ - Bounded the text sent to `ocskill task-policy` so very large pasted prompts no longer risk Windows command-line length failures; the full user prompt still goes to the model while only a bounded head/tail classification view goes through the CLI.
20
+ - Routed skill classification from the actual user request instead of the expanded command template, reducing template-induced over-routing on long prompts.
21
+ - Kept installer result shape stable with `promptAliases: []` on foreign-state refusal.
22
+
23
+ ### Regression coverage
24
+ - Added fenced-paste, BOM, 70k-character policy-input and oversized multiline `/ues-run` regression tests.
25
+
26
+ ## [13.0.0-beta.0] - 2026-09-22
27
+
28
+ ### Added
29
+ - Added native same-model parallel execution through `ues.dispatch_parallel` with bounded adaptive concurrency.
30
+ - Added event-driven DAG scheduling so newly unblocked tasks can start without waiting for an entire wave barrier.
31
+ - Added read/write resource leases, conservative unknown-scope serialization and shared-config writer serialization.
32
+ - Added inherited-root worktree snapshots so downstream tasks see already integrated predecessor changes without committing the user's root branch.
33
+ - Added transactional integration with sandbox rollback when receipt/completion fails after patch application.
34
+ - Added fresh same-model verifier sessions and agent-verifier receipts tied to the active run and current workspace fingerprint.
35
+ - Added global CLI help interception, structured `--json` errors, `work status .` workspace listing, UTF-8/UTF-16 auto-decoding, safe UTF-8 Git diff output and text normalization.
36
+
37
+ ### Regression coverage
38
+ - Added V13 tests for CLI help parsing, structured errors, UTF-16 PowerShell-style diff decoding, event-driven same-model concurrency, resource conflict serialization and inherited-root rollback behavior.
39
+ - Added verifier-runtime regression coverage against forged/user-supplied PASS markers and malformed verdict lines.
40
+ - Added structured `verificationCommands` validation coverage for deterministic post-integration receipts.
41
+
42
+ ### Fixed
43
+ - Fixed the V13 structured-verification regression test wiring so the current HEAD test suite can execute the new plan-schema assertions.
44
+ - Fixed npm 11+ lifecycle-script blocking in release smoke expectations: a plain global install may require the documented `ocskill install` resource-sync fallback, and CI now verifies that fallback instead of falsely requiring postinstall execution.
45
+ - Clarified OpenCode 1.x versus V2 capability boundaries and fenced canonical long-task state to `.ues-work/<slug>/`; legacy/manual `ues-work/` directories are no longer treated as official UES state.
46
+ - Added `repo-graph --compact` and switched initial long-run evidence gathering to compact hotspot/count summaries to reduce large-repository context/tool-output overhead.
47
+ - Made `ocskill install/status/doctor` surface the OpenCode 1.x versus V2 native-parallel boundary directly so users do not mistake V13 CLI availability for fresh-session parallel availability.
48
+ - Hardened migration from V12/manual Windows artifacts by auto-decoding UTF-8/UTF-16 `PLAN.json`, `STATE.json`, `SPEC.md` and dependency reports across the CLI/task engine and V2 parallel router.
49
+ - Added bounded `ocskill text-read` so OpenCode 1.x can recover known UTF text that its generic Read tool classifies as binary, without creating ad-hoc converted copies.
50
+ - Extended packed-install smoke and regressions to cover the UTF recovery command, UTF durable state discovery and legacy artifact context packs.
51
+ - Removed the stale clean-root-only restriction from native parallel dispatch. Existing dirty repository state is now treated as an inherited baseline, while isolated worktree delta integration, resource leases and rollback continue to protect user changes.
52
+ - Fixed inherited untracked-file handling so a parallel worker may safely edit an unchanged pre-existing untracked file, while a user edit that races after sandbox creation is still detected and rejected as a conflict.
53
+ - Aligned legacy smoke tests with V13 structured usage exit code 2 and typed verification evidence (`command-receipt-backed` / `independent-agent-receipt-backed`).
54
+ - Fixed `work status` receipt coverage accounting for the typed V13 evidence strengths and made inherited-untracked worktree regressions line-ending neutral on Windows.
55
+
56
+
9
57
  ## [12.0.0-beta.0] - 2026-09-22
10
58
 
11
59
  ### Beta
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # OpenCode Universal Engineering System (UES)
2
2
 
3
- > **V12 beta: 12.0.0-beta.0** — weak-model intelligence foundation với empirical routing, context-quality metrics, plan-scoped execution và repo-scale validation.
4
- > **Stable latest vẫn là V11: 11.0.0.** Dùng `npm install -g opencode-agent-skill@next` để thử V12 beta.
3
+ > **V13 beta: 13.0.0-beta.1** — parallel weak-model runtime với same-model worker pool, event-driven DAG, transactional worktree integration và hardened CLI/Windows runtime.
4
+ > **Stable latest vẫn là V11: 11.0.0.** V13 được đóng gói dưới prerelease `13.0.0-beta.1`; npm prerelease dùng dist-tag `next`, còn `latest` tiếp tục giữ V11 cho đến khi V13 được promote stable.
5
5
 
6
6
  [![npm version](https://img.shields.io/npm/v/opencode-agent-skill.svg)](https://www.npmjs.com/package/opencode-agent-skill)
7
7
  [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
@@ -22,6 +22,47 @@ Mục tiêu của UES là giúp quá trình làm việc với coding agent **ổ
22
22
 
23
23
  ---
24
24
 
25
+
26
+ ## V13 beta: Parallel Weak-Model Runtime
27
+
28
+ V13 cho phép **một model duy nhất** chạy nhiều fresh child sessions song song. `ues.dispatch_parallel` chọn một shared model (hoặc giữ OpenCode default model), chạy các task độc lập theo event-driven DAG, dùng resource lease để tránh writer conflict, tạo worktree riêng cho writer, dùng fresh same-model `ues-verifier`, rồi tích hợp tuần tự. Nếu bước receipt/complete thất bại sau khi patch đã áp dụng, integration transaction tự rollback patch của task đó.
29
+
30
+ ```text
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
+ ```
45
+
46
+ CLI V13 cũng xử lý `--help` trước positional parsing, hỗ trợ `ocskill work status .`, structured errors với `--json`, đọc UTF-8/UTF-16 an toàn và cung cấp `ocskill diff . --out dirty.diff` để tránh PowerShell tạo diff UTF-16 bị OpenCode nhận nhầm là binary.
47
+
48
+ Parallel resume không còn yêu cầu root phải sạch tuyệt đối. Nếu repository đã có dirty diff hợp lệ từ phiên trước, V13 chụp baseline đó vào worktree cô lập và chỉ tích hợp delta của task; thay đổi cũ được giữ nguyên. Root vẫn phải là Git repository và resource leases vẫn chặn các writer xung đột.
49
+
50
+ > **Compatibility:** V13 CLI/durable-state/verification hardening vẫn dùng được trên OpenCode 1.x. Native `ues.dispatch_task` / `ues.dispatch_parallel` cần router plugin và fresh-session APIs của OpenCode V2; nếu capability không đủ, runtime fail closed thay vì giả vờ chạy song song.
51
+
52
+ ### V13 beta validation baseline
53
+
54
+ Baseline beta.0 đã được kiểm tra local trên Windows 10 với OpenCode V2.0.15; beta.1 phải chạy lại full gate trước khi publish:
55
+
56
+ - `npm run evals:v13`: **36/36 PASS**;
57
+ - `npm test`: **298 tests**, **296 pass**, **0 fail**, **2 platform-specific skip**;
58
+ - managed `ues-router` load thành công dưới `~/.config/opencode/plugins/ues-router`;
59
+ - router không còn phụ thuộc runtime bare import `@opencode/plugin`, nên clean global OpenCode config vẫn load được;
60
+ - các subprocess nội bộ của router (`where`, `ocskill`, Node shim và Git probes) dùng hidden-window spawn trên Windows để tránh cửa sổ CMD nháy liên tục;
61
+ - npm 11+ vẫn có thể chặn lifecycle script theo `allowScripts`; `ocskill install` là resource-sync fallback chính thức.
62
+
63
+ ---
64
+
65
+
25
66
  ## Cài đặt
26
67
 
27
68
  Yêu cầu:
@@ -30,12 +71,26 @@ Yêu cầu:
30
71
  - npm;
31
72
  - OpenCode.
32
73
 
33
- Cài đặt toàn cục từ npm:
74
+ Cài đặt stable hiện tại từ npm:
34
75
 
35
76
  ```cmd
36
77
  npm install -g opencode-agent-skill
37
78
  ```
38
79
 
80
+ Cài V13 beta từ npm sau khi prerelease đã có trên registry:
81
+
82
+ ```cmd
83
+ npm install -g opencode-agent-skill@next
84
+ ocskill install
85
+ ```
86
+
87
+ Nếu đang kiểm thử một commit mới hơn bản registry, cài trực tiếp từ checkout:
88
+
89
+ ```cmd
90
+ npm install -g .
91
+ ocskill install
92
+ ```
93
+
39
94
  Kiểm tra:
40
95
 
41
96
  ```cmd
@@ -44,13 +99,21 @@ ocskill status
44
99
  ocskill doctor
45
100
  ```
46
101
 
47
- Nếu npm không chạy lifecycle script trong lúc cài đặt, chạy thêm:
102
+ Nếu npm không chạy lifecycle script trong lúc cài đặt (npm 11+ có thể cảnh báo `install-scripts ... not yet covered by allowScripts`), package CLI vẫn có thể đã được cài. Chạy resource sync rõ ràng:
48
103
 
49
104
  ```cmd
50
105
  ocskill install
51
106
  ```
52
107
 
53
- Sau khi cài hoặc cập nhật UES, nên mở một OpenCode session mới để các skill, command, subagent và plugin được nạp lại đầy đủ.
108
+ Đây là fallback được CI smoke kiểm tra; không cần dùng `--force` chỉ để vượt cảnh báo lifecycle script.
109
+
110
+ Sau khi cài hoặc cập nhật UES, hãy restart OpenCode service rồi mở một session mới để skill, command, subagent và plugin được nạp lại đầy đủ:
111
+
112
+ ```cmd
113
+ opencode service restart
114
+ ```
115
+
116
+ Trên OpenCode V2 có thể kiểm tra router bằng `/plugins`, sau đó gọi `ues.capabilities`. Native parallel chỉ nên dùng khi `freshDispatch` báo `true`.
54
117
 
55
118
  ---
56
119
 
@@ -72,7 +135,7 @@ Một số lệnh hữu ích:
72
135
 
73
136
  ```cmd
74
137
  ocskill inspect .
75
- ocskill repo-graph .
138
+ ocskill repo-graph . --compact
76
139
  ocskill verification-plan .
77
140
  ocskill task-policy "refactor auth across the whole repository"
78
141
  ocskill dashboard . --serve
@@ -333,6 +396,24 @@ Child session không được tự động merge, push, publish hoặc deploy.
333
396
 
334
397
  ## Slash commands
335
398
 
399
+ Trên OpenCode 1.x, UES tiếp tục cài các command Markdown native. Trên OpenCode V2, 11 lệnh `/ues-*` được cài dưới dạng **prompt aliases** của `ues-router`: UI gửi chúng qua đường `session.prompt` đang ổn định, router mới mở rộng template UES. Cách này tránh phụ thuộc vào `session.command` V2 khi endpoint custom-command trả lỗi transport/content-type. Cú pháp người dùng không đổi, cả hai dạng đều hợp lệ:
400
+
401
+ ```text
402
+ /ues-run <yêu cầu>
403
+ ```
404
+
405
+ hoặc:
406
+
407
+ ```text
408
+ /ues-run
409
+
410
+ <yêu cầu nhiều dòng>
411
+ ```
412
+
413
+ Trên V2 các alias này có thể không xuất hiện trong autocomplete slash menu vì UES chủ động không đăng ký native custom-command để tránh đường `session.command` đang lỗi; vẫn có thể gõ trực tiếp `/ues-run`, `/ues-fix`, v.v.
414
+
415
+ Sau khi nâng cấp từ bản V13 cũ, chạy `ocskill install`; installer sẽ xóa các native UES command file cũ do chính UES quản lý để OpenCode V2 không còn bắt chúng qua `session.command`.
416
+
336
417
  | Lệnh | Công dụng |
337
418
  |---|---|
338
419
  | `/ues-feature` | Triển khai feature theo workflow UES |
@@ -407,10 +488,11 @@ Model ID do người dùng cấu hình vẫn là nguồn quyết định cuối
407
488
  | Lệnh | Công dụng |
408
489
  |---|---|
409
490
  | `ocskill inspect [dir]` | Phát hiện stack, package manager, root và test command |
410
- | `ocskill repo-graph [dir]` | Lập import graph có giới hạn và tìm hotspot |
491
+ | `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 |
411
492
  | `ocskill impact <query> [dir]` | Tìm phạm vi ảnh hưởng theo symbol hoặc từ khóa |
412
493
  | `ocskill evidence [dir]` | Thu thập snapshot về repository, verification và Git |
413
494
  | `ocskill working-tree [dir]` | Kiểm tra branch, HEAD và working tree |
495
+ | `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 |
414
496
  | `ocskill review-scope [base] [dir]` | Phân tích changed-file coverage và risk hint |
415
497
  | `ocskill verification-plan [dir]` | Đề xuất verification phù hợp với project |
416
498
  | `ocskill task-graph <PLAN.json>` | Kiểm tra DAG và tính safe waves |
@@ -420,7 +502,7 @@ Model ID do người dùng cấu hình vẫn là nguồn quyết định cuối
420
502
  Ví dụ:
421
503
 
422
504
  ```cmd
423
- ocskill repo-graph .
505
+ ocskill repo-graph . --compact
424
506
  ocskill review-scope main .
425
507
  ocskill verification-plan .
426
508
  ocskill task-graph .ues-work/checkout/PLAN.json
@@ -476,7 +558,7 @@ Plugin cung cấp:
476
558
  - context guardrail;
477
559
  - permission safety gate;
478
560
  - read-only long-task helpers;
479
- - fresh-session executor runtime qua `ues.dispatch_task`.
561
+ - fresh-session executor runtime qua `ues.dispatch_task` và same-model parallel runtime qua `ues.dispatch_parallel`.
480
562
 
481
563
  Điều khiển router:
482
564
 
@@ -716,6 +798,7 @@ UES chỉ quản lý resource có namespace/marker của chính nó và cố g
716
798
  - [V8 Intelligence & Reliability](docs/V8-INTELLIGENCE-RELIABILITY.md)
717
799
  - [V9 Speed & Intelligence](docs/V9-SPEED-INTELLIGENCE.md)
718
800
  - [V12 Weak-Model Intelligence (beta)](docs/V12-WEAK-MODEL-INTELLIGENCE.md)
801
+ - [V13 Parallel Weak-Model Runtime (beta)](docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md)
719
802
 
720
803
  ---
721
804
 
@@ -736,10 +819,26 @@ npm install -g opencode-agent-skill
736
819
  Phiên bản hiện tại:
737
820
 
738
821
  ```text
739
- 12.0.0-beta.0
822
+ 13.0.0-beta.1
823
+ ```
824
+
825
+ V13 beta dùng npm dist-tag `next`; `latest` tiếp tục trỏ tới V11 stable cho đến khi các release gate V13 hoàn tất.
826
+
827
+ Maintainer packaging gate:
828
+
829
+ ```cmd
830
+ npm run ci
831
+ npm pack --dry-run
832
+ npm pack
833
+ ```
834
+
835
+ Trước khi publish, kiểm tra version chưa tồn tại trên registry:
836
+
837
+ ```cmd
838
+ npm view opencode-agent-skill@13.0.0-beta.1 version --registry=https://registry.npmjs.org/
740
839
  ```
741
840
 
742
- V12 beta dùng npm dist-tag `next`; `latest` tiếp tục trỏ tới V11 stable cho đến khi các release gate V12 hoàn tất.
841
+ Nếu version chưa tồn tại, prerelease được publish với dist-tag `next`.
743
842
 
744
843
  ---
745
844