opencode-agent-skill 11.0.0 → 13.0.0-beta.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +119 -14
  3. package/bin/ocskill.mjs +416 -83
  4. package/docs/DETERMINISTIC-TOOLS.md +1 -1
  5. package/docs/ENGINEERING-DESIGN.md +4 -4
  6. package/docs/EVALS.md +3 -3
  7. package/docs/GITHUB-RULESET.md +50 -0
  8. package/docs/NPM-PUBLISH.md +22 -8
  9. package/docs/OPENCODE-COMPAT.md +14 -4
  10. package/docs/TRACE-SCHEMA.md +1 -1
  11. package/docs/V11-PERCEPTION-ADAPTIVE.md +2 -2
  12. package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +27 -0
  13. package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +75 -0
  14. package/evals/repo-scale/tasks.json +62 -0
  15. package/global-config/AGENTS.md +4 -0
  16. package/global-config/commands/resume.md +4 -1
  17. package/global-config/commands/run.md +9 -7
  18. package/global-config/plugins/ues-router/capabilities.js +1 -0
  19. package/global-config/plugins/ues-router/command-runtime.js +79 -0
  20. package/global-config/plugins/ues-router/index.js +364 -43
  21. package/global-config/plugins/ues-router/parallel-runtime.js +271 -0
  22. package/global-config/plugins/ues-router/text-runtime.js +115 -0
  23. package/global-config/plugins/ues-router/verifier-runtime.js +33 -0
  24. package/global-config/skills/dynamic-workflow/SKILL.md +7 -6
  25. package/global-config/skills/dynamic-workflow/references/workflow.md +8 -6
  26. package/global-config/skills/engineering-orchestrator/references/long-horizon.md +7 -5
  27. package/lib/cli-utils.mjs +17 -4
  28. package/lib/context-engine-v11.mjs +4 -0
  29. package/lib/context-quality.mjs +59 -0
  30. package/lib/decision-policy.mjs +23 -0
  31. package/lib/installer.mjs +49 -16
  32. package/lib/model-config.mjs +13 -1
  33. package/lib/model-performance.mjs +113 -0
  34. package/lib/model-policy.mjs +9 -2
  35. package/lib/repo-scale-fixture.mjs +45 -0
  36. package/lib/task-engine.mjs +36 -12
  37. package/lib/task-graph.mjs +32 -0
  38. package/lib/text-encoding.mjs +74 -0
  39. package/lib/work-plan-scope.mjs +49 -0
  40. package/lib/worktree-sandbox.mjs +141 -12
  41. package/package.json +8 -4
  42. package/scripts/check-release-consistency.mjs +260 -0
  43. package/scripts/smoke-packed-install.mjs +39 -3
  44. package/scripts/smoke-plain-install.mjs +27 -7
  45. package/scripts/validate-repo-scale-suite.mjs +27 -0
  46. package/scripts/validate-v12-foundation.mjs +24 -0
  47. package/scripts/validate.mjs +18 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,61 @@ 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.0] - 2026-09-22
16
+
17
+ ### Added
18
+ - Added native same-model parallel execution through `ues.dispatch_parallel` with bounded adaptive concurrency.
19
+ - Added event-driven DAG scheduling so newly unblocked tasks can start without waiting for an entire wave barrier.
20
+ - Added read/write resource leases, conservative unknown-scope serialization and shared-config writer serialization.
21
+ - Added inherited-root worktree snapshots so downstream tasks see already integrated predecessor changes without committing the user's root branch.
22
+ - Added transactional integration with sandbox rollback when receipt/completion fails after patch application.
23
+ - Added fresh same-model verifier sessions and agent-verifier receipts tied to the active run and current workspace fingerprint.
24
+ - 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.
25
+
26
+ ### Regression coverage
27
+ - 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.
28
+ - Added verifier-runtime regression coverage against forged/user-supplied PASS markers and malformed verdict lines.
29
+ - Added structured `verificationCommands` validation coverage for deterministic post-integration receipts.
30
+
31
+ ### Fixed
32
+ - Fixed the V13 structured-verification regression test wiring so the current HEAD test suite can execute the new plan-schema assertions.
33
+ - 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.
34
+ - 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.
35
+ - Added `repo-graph --compact` and switched initial long-run evidence gathering to compact hotspot/count summaries to reduce large-repository context/tool-output overhead.
36
+ - 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.
37
+ - 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.
38
+ - 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.
39
+ - Extended packed-install smoke and regressions to cover the UTF recovery command, UTF durable state discovery and legacy artifact context packs.
40
+ - 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.
41
+ - 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.
42
+ - Aligned legacy smoke tests with V13 structured usage exit code 2 and typed verification evidence (`command-receipt-backed` / `independent-agent-receipt-backed`).
43
+ - Fixed `work status` receipt coverage accounting for the typed V13 evidence strengths and made inherited-untracked worktree regressions line-ending neutral on Windows.
44
+
45
+
46
+ ## [12.0.0-beta.0] - 2026-09-22
47
+
48
+ ### Beta
49
+ - Added empirical per-task-class model performance history and capability-preserving reranking with a minimum evidence threshold before reranking.
50
+ - Added context quality receipts for required-file recall and irrelevant-context ratio.
51
+ - Added hash-keyed plan snapshots with active-plan execution fencing.
52
+ - Added bounded decision policy for reversible local rulings versus human-gated destructive/external actions.
53
+ - Added deterministic repo-scale benchmark fixture generation and V12/repo-scale validation gates.
54
+ - Hardened release consistency checks to derive eval counts and validate aggregate workflow structure.
55
+ - Fixed missing empirical-history handling so models without benchmark history safely fall back to static capability routing.
56
+
57
+ ### Verified locally on Windows
58
+ - 255 tests total: 253 passed, 0 failed, 2 platform-specific skips.
59
+ - Syntax, catalog validation, docs consistency, routing, V11/V12/repo-scale/live/long/polyglot validation: PASS.
60
+ - npm pack, packed-install smoke and plain one-command install/resource auto-sync smoke: PASS.
61
+ - Published prerelease intent: npm dist-tag `next`; V11 remains `latest` until V12 stable release gates are satisfied.
62
+
63
+
9
64
  ## [11.0.0] - 2026-09-22
10
65
 
11
66
  ### Released
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # OpenCode Universal Engineering System (UES)
2
2
 
3
- > **V11 stable: 11.0.0** — perception-aware adaptive execution engine với evidence-efficient context, capability routing và visual/browser verification.
4
- > UES là bộ công cụ hỗ trợ OpenCode xử lý dự án lớn, tác vụ dài và quy trình kỹ thuật cần kiểm chứng bằng bằng chứng thực tế.
3
+ > **V13 beta: 13.0.0-beta.0** — 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.0`; 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 hiện tại
53
+
54
+ Bản đóng gói hiện tại đã được kiểm tra local trên Windows 10 với OpenCode V2.0.15:
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
@@ -431,7 +513,7 @@ ocskill work status checkout .
431
513
 
432
514
  ## Skills
433
515
 
434
- V11 development hiện có **48 skills**; V10 stable có 39. Router vẫn chỉ chọn tập skill phù hợp thay vì nạp toàn bộ catalog vào mỗi task. Router chỉ chọn các skill phù hợp thay vì nạp toàn bộ catalog vào mỗi task.
516
+ V11 stable hiện có **48 skills**; V10 stable có 39. Router vẫn chỉ chọn tập skill phù hợp thay vì nạp toàn bộ catalog vào mỗi task.
435
517
 
436
518
  Một số process skill quan trọng:
437
519
 
@@ -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
 
@@ -592,10 +674,11 @@ Integration sẽ từ chối ghi đè lên file đang dirty ở root. Safe-wave
592
674
 
593
675
  ## Evaluation
594
676
 
595
- UES 9.0.0 hiện có:
677
+ V11 hiện có:
596
678
 
597
- - **34 static skill-routing scenarios** phủ 39 skills;
598
- - **120 V2 router cases** với required routes và negative guards;
679
+ - **43 static skill-routing scenarios** phủ 48 skills;
680
+ - **129 V2 router cases** với required routes và negative guards;
681
+ - **13 V11 contract tasks** across 6 categories;
599
682
  - **20 standard live tasks**;
600
683
  - **5 long-horizon tasks**;
601
684
  - **8 polyglot tasks** cho Python, Java, .NET, Next.js, React Native, SQL migration, monorepo và generated contract;
@@ -667,11 +750,13 @@ Pipeline hiện kiểm tra:
667
750
  ```text
668
751
  syntax
669
752
  → resource validation
753
+ → docs:check
670
754
  → static skill routing
671
755
  → V2 router matrix
672
756
  → standard hidden-grader integrity
673
757
  → long hidden-grader integrity
674
758
  → polyglot hidden-grader integrity
759
+ → V11 contract validation
675
760
  → Node tests
676
761
  → npm pack --dry-run
677
762
  → packed global-install smoke
@@ -712,6 +797,8 @@ UES chỉ quản lý resource có namespace/marker của chính nó và cố g
712
797
  - [V7 Intelligence Runtime](docs/V7-INTELLIGENCE-RUNTIME.md)
713
798
  - [V8 Intelligence & Reliability](docs/V8-INTELLIGENCE-RELIABILITY.md)
714
799
  - [V9 Speed & Intelligence](docs/V9-SPEED-INTELLIGENCE.md)
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)
715
802
 
716
803
  ---
717
804
 
@@ -732,9 +819,27 @@ npm install -g opencode-agent-skill
732
819
  Phiên bản hiện tại:
733
820
 
734
821
  ```text
735
- 9.0.0
822
+ 13.0.0-beta.0
736
823
  ```
737
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.0 version --registry=https://registry.npmjs.org/
839
+ ```
840
+
841
+ Nếu version chưa tồn tại, prerelease được publish với dist-tag `next`.
842
+
738
843
  ---
739
844
 
740
845
  ## License