@zq-silk/yui 2.6.0 → 2.7.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.
Files changed (72) hide show
  1. package/README.md +23 -0
  2. package/dist/cli/commandCatalog.js +28 -2
  3. package/dist/commands/globalRoleCommands.js +22 -2
  4. package/dist/commands/inboxCommands.js +352 -0
  5. package/dist/commands/roleSkillValidation.js +2 -0
  6. package/dist/commands/taskCommands.js +32 -4
  7. package/dist/context/currentSkills.js +48 -0
  8. package/dist/context/roleSessionContext.js +13 -16
  9. package/dist/context/runContextPack.js +2 -0
  10. package/dist/context/runInputContract.js +1 -1
  11. package/dist/context/sessionBootstrapManifest.js +27 -4
  12. package/dist/context/skillCatalog.js +2 -3
  13. package/dist/context/taskContext.js +2 -0
  14. package/dist/controlPlaneCli.js +18 -1
  15. package/dist/controller/controller.js +3 -2
  16. package/dist/controller/fileSchedulerStoreAdapter.js +19 -4
  17. package/dist/controller/globalInputDelivery.js +73 -15
  18. package/dist/controller/globalRuntimeAttention.js +1 -1
  19. package/dist/controller/operatorNotification.js +6 -1
  20. package/dist/controller/providerRetryDelivery.js +3 -5
  21. package/dist/controller/runtime.js +2 -2
  22. package/dist/doctor/doctor.js +25 -2
  23. package/dist/executor/effectiveLaunch.js +2 -2
  24. package/dist/executor/fileRoleLaunchPlanner.js +4 -6
  25. package/dist/interaction/notificationPresentation.js +2 -2
  26. package/dist/interaction/operatorPresentation.js +1 -1
  27. package/dist/message/globalInputBacklog.js +69 -0
  28. package/dist/message/globalMessageQuery.js +1 -0
  29. package/dist/message/inboxReceipt.js +32 -0
  30. package/dist/message/message.js +6 -1
  31. package/dist/message/messageContinuation.js +34 -13
  32. package/dist/message/taskInboxOwnership.js +21 -0
  33. package/dist/nativeAgent/session/backends.js +1 -1
  34. package/dist/observability/runtimeIdentity.js +1 -1
  35. package/dist/resources/sqliteResourceRegistry.js +1 -1
  36. package/dist/runtime/agentHost.js +105 -16
  37. package/dist/scheduler/operatorEvent.js +49 -0
  38. package/dist/scheduler/operatorInputNotificationProcessor.js +5 -4
  39. package/dist/scheduler/taskWake.js +5 -0
  40. package/dist/sqlite/driver.js +108 -0
  41. package/dist/storage/sqliteSchema.js +11 -1
  42. package/dist/storage/sqliteStore.js +60 -1
  43. package/dist/storage/storageSchema.js +1 -1
  44. package/dist/storage/storageVersions.js +1 -1
  45. package/dist/storage/storeRpc.js +1 -0
  46. package/dist/storage/upgrade/upgradeOrchestrator.js +1 -1
  47. package/dist/task/completionReadiness.js +11 -4
  48. package/dist/telemetry/sqliteTelemetryStore.js +1 -1
  49. package/docs/managed-turn-and-session-runtime.md +81 -5
  50. package/docs/managed-turn-and-session-runtime.zh-CN.md +51 -3
  51. package/docs/release-workflow.md +47 -2
  52. package/docs/release-workflow.zh-CN.md +34 -1
  53. package/docs/storage-baseline.md +17 -7
  54. package/docs/storage-baseline.zh-CN.md +11 -5
  55. package/docs/task-delivery.md +17 -8
  56. package/docs/task-delivery.zh-CN.md +11 -5
  57. package/docs/testing/verification-levels.md +22 -4
  58. package/docs/testing/verification-levels.zh-CN.md +8 -1
  59. package/i18n/README.zh-CN.md +19 -0
  60. package/package.json +5 -2
  61. package/skills/yui-leader/SKILL.md +28 -11
  62. package/skills/yui-leader/VERSION +1 -0
  63. package/skills/yui-operator/SKILL.md +10 -2
  64. package/skills/yui-operator/VERSION +1 -0
  65. package/skills/yui-operator/references/task-delivery.md +2 -0
  66. package/skills/yui-reviewer/SKILL.md +8 -1
  67. package/skills/yui-reviewer/VERSION +1 -0
  68. package/skills/yui-runtime/SKILL.md +94 -11
  69. package/skills/yui-runtime/VERSION +1 -0
  70. package/skills/yui-runtime/references/publication.md +16 -5
  71. package/skills/yui-worker/SKILL.md +8 -1
  72. package/skills/yui-worker/VERSION +1 -0
@@ -51,6 +51,50 @@ merely to avoid a version decision. Package versions remain distinct from protoc
51
51
  and persistent-storage contracts: their compatibility checks and required migrations
52
52
  are unchanged, and the storage rules below do not authorize a package release.
53
53
 
54
+ ### 2.7.1 compatibility and migration notes
55
+
56
+ This release delivers the intended 2.7 feature line. The `v2.7.0` attempt stopped
57
+ before npm publication because package smoke compared a macOS temporary path
58
+ with its physical alias. The smoke now uses the physical package root; its
59
+ assertions and the cross-platform release gate remain intact.
60
+
61
+ This minor adds own-scope Agent inbox discovery, full reads, claims and
62
+ acknowledgements for GlobalRoles and Task Leaders, Workers and Reviewers.
63
+ Use `yui inbox list/show/claim/ack` from the current managed Session; reads do
64
+ not consume input, claims do not grant additional authority, and an
65
+ acknowledgement is not execution-result acceptance. Durable receipts arbitrate
66
+ with automatic delivery without replaying unknown native input.
67
+
68
+ Storage advances from **1.6 to 1.7** through the centralized additive migration
69
+ for Message and Leader-wake inbox receipts. Use `yui update --version 2.7.1`
70
+ for an exact upgrade; the updater preflights the target Home, takes a backup
71
+ when migration is required, and coordinates the exact Controller replacement.
72
+ Do not edit stored records manually. Task, Session and original input history
73
+ remain authoritative.
74
+
75
+ Runtime and Role instructions now use stable current source paths and independent
76
+ integer `VERSION` files. Every managed turn checks `yui session skills --json`;
77
+ only unchanged full instructions still present in context may be reused.
78
+ Recovery, version changes and missing/uncertain context require full reload.
79
+ Configured Skills must supply `VERSION` beside `SKILL.md`.
80
+
81
+ Frozen packages remain historical audit, not a Session admission condition.
82
+ Valid pre-1.5 Sessions may resume without that evidence; no historical read,
83
+ native acceptance or input consumption is fabricated. Identity, scope, writer,
84
+ lifecycle, protocol/storage and unknown-input fences are unchanged. The Skill
85
+ loading change itself adds no storage migration.
86
+
87
+ This release also recovers Operator notification backlogs and Desktop-direct
88
+ terminal facts across Controller replacement, retaining exact input and Turn
89
+ identities. SQLite prefers the pinned modern N-API driver, with a bounded
90
+ compatibility fallback when that optional native candidate is unavailable;
91
+ this fixes the reproduced Node 24 native GC abort.
92
+
93
+ Deterministic core checks and isolated assembled/fresh-install package smoke
94
+ are the release evidence; they do not establish real-model behavior.
95
+ Publishing this package alone does not authorize a global CLI update, Home
96
+ migration or Controller replacement.
97
+
54
98
  ### 2.6.0 compatibility and migration notes
55
99
 
56
100
  This minor includes Task111's paged current activity and parallel execution
@@ -118,8 +162,9 @@ fixes are included; Task110's unmerged work is not part of this release.
118
162
  Storage is now **1.6**. Use the supported centralized, contiguous same-major
119
163
  upgrade path for older supported Homes; do not edit stored records manually.
120
164
  Historical missing cost remains unknown. Old Skill provenance is not rebuilt
121
- from today's files: if restoring an old Session reports missing frozen-package
122
- evidence, follow its new-Session guidance while preserving the old history.
165
+ from today's files. The original 2.4 restoration restriction for missing packages
166
+ is superseded by the current Skill-loading contract above; preserve old history
167
+ without making that audit evidence a Session admission condition.
123
168
  Current model adoption is connection-local and does not change future defaults;
124
169
  exit the Host-owned native TUI before changing its model (closing a viewer only
125
170
  detaches it). Unknown sends must be inspected by their original request ID,
@@ -36,6 +36,38 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
36
36
  不能将不兼容冒称为兼容,也不为回避版本选择新增历史兼容机制。包版本与协议、
37
37
  持久存储契约仍然独立:兼容性检查和必要迁移要求不变,下文存储规则不授予发版权限。
38
38
 
39
+ ### 2.7.1 兼容性及迁移说明
40
+
41
+ 本版交付原定的 2.7 功能。`v2.7.0` 的运行包冒烟将 macOS 临时路径与其物理别名
42
+ 直接比较,在 npm 发布前停止;现改用物理包根路径,原有断言和跨平台发布门禁
43
+ 保持不变。
44
+
45
+ 本 minor 增加 GlobalRole 及 Task Leader、Worker、Reviewer 自身作用域的 Agent
46
+ 收件箱发现、全文读取、领取与确认。在当前受管理 Session 中使用
47
+ `yui inbox list/show/claim/ack`;读取不消费输入,claim 不增加权限,ack 不是执行结果
48
+ 验收。持久回执与自动投递仲裁,不重放结果未知的原生输入。
49
+
50
+ 存储通过集中式增量迁移从 **1.6 升至 1.7**,为 Message 和 Leader wake 增加收件箱
51
+ 回执。确切升级使用 `yui update --version 2.7.1`;更新器预检目标 Home,在需要迁移
52
+ 时备份,并协调确切 Controller 的替换。不要手工编辑存储记录,Task、Session
53
+ 及原始输入历史仍为权威。
54
+
55
+ Runtime/Role Skill 使用稳定源入口和独立的整数 `VERSION` 文件。每轮执行
56
+ `yui session skills --json`;只有版本未变且全文仍在当前上下文时才复用,版本变化、
57
+ 恢复或上下文缺失/不确定时全文重读。自定义 Skill 须在 `SKILL.md` 旁提供 `VERSION`。
58
+
59
+ 冻结包仅作历史审计,不再是 Session 准入条件;合法 1.5 以前的 Session 可在缺少
60
+ 该证据时恢复,不补造已读、原生接受或输入消费回执。身份、作用域、writer、
61
+ 生命周期、协议/存储兼容与未知输入不重放边界保持不变。Skill 加载变更本身不增加
62
+ 存储迁移。
63
+
64
+ 本版还恢复 Controller 替换期间积压的 Operator 通知和 Desktop 直连终态事实,
65
+ 保留精确输入与 Turn 身份。SQLite 优先使用固定版本的现代 N-API 驱动,在可选原生
66
+ 候选不可用时有界回退至兼容候选,修复已复现的 Node 24 原生 GC 崩溃。
67
+
68
+ 发版证据为确定性核心检查及隔离的组装/全新安装运行包冒烟,不代表真实模型行为
69
+ 验证。仅发布本包不授予全局 CLI 更新、Home 迁移或 Controller 替换权限。
70
+
39
71
  ### 2.6.0 兼容性及迁移说明
40
72
 
41
73
  本 minor 包含 Task111 的当前活动分页与并行执行摘要。任务运行列表可发现超出
@@ -87,7 +119,8 @@ Task110 尚未合入的工作不属于本版本。
87
119
 
88
120
  存储版本现为 **1.6**。旧的受支持 Home 应走集中、连续的同主版本升级路径,
89
121
  不要手工修改存储记录。历史缺失费用仍为未知;旧 Skill 来源不会从今天的文件
90
- 补造。恢复旧 Session 若提示缺少冻结包证据,应保留旧历史并按提示建立新 Session。
122
+ 补造。2.4 原有“恢复需要冻结包”的限制已由上述当前加载契约取代;
123
+ 保留旧历史,不再将缺少冻结包作为 Session 准入门槛。
91
124
  当前模型操作只作用于本次连接,不修改未来默认值;切换模型前须退出 Host 持有的
92
125
  原生 TUI,关闭浏览器查看器仅断开查看。未知发送必须查询原 request-id,
93
126
  不能通过新标签页重放。这些是明确的行为边界,不是一般向后兼容承诺。
@@ -2,7 +2,13 @@
2
2
 
3
3
  # Storage baseline 1.0
4
4
 
5
- Current storage is 1.6. The declared 1.5 → 1.6 transition adds optional
5
+ Current storage is 1.7. The declared 1.6 → 1.7 transition adds optional Agent
6
+ inbox claim and acknowledgement receipts to canonical Messages and Leader
7
+ wakes, including the exact pending-window identity. Historical records and
8
+ frozen Context digests remain unchanged; missing handling evidence is never
9
+ backfilled as delivery or consumption. The SQL layout is unchanged.
10
+
11
+ The declared 1.5 → 1.6 transition adds optional
6
12
  source-attributed monetary evidence to canonical runtime observations. Existing
7
13
  observations remain unchanged: absent amounts and prices stay unknown. The SQL
8
14
  layout is unchanged.
@@ -28,9 +34,10 @@ The 1.4 → 1.5 transition introduces complete Skill package references in
28
34
  effective launch snapshots and Session Manifests. Historical records and their
29
35
  digests are preserved byte-for-byte; missing package metadata explicitly means
30
36
  legacy entrypoint-only/unrecorded evidence. Migration cannot recover resources
31
- that were never captured. Existing running Hosts keep their original inputs;
32
- restoring a legacy Session requires explicitly selecting a new Session. No
33
- ordinary reader backfills historical versions from mutable sources.
37
+ that were never captured. Existing running Hosts keep their original inputs.
38
+ Current loading uses stable source paths and internal versions; restoring a
39
+ valid legacy Session does not require frozen-package evidence or replacement.
40
+ No ordinary reader backfills historical versions from mutable sources.
34
41
 
35
42
  New launches snapshot raw resources under `runtime/skill-packages/<digest>`.
36
43
  The version covers sorted relative paths, SHA-256 byte digests, sizes and
@@ -40,9 +47,12 @@ Symlinks and special files are rejected, as are packages exceeding 2,048 files,
40
47
  8 MiB per file, 32 MiB total or 32 directory levels. Scripts are retained,
41
48
  never run on import. Sources must be readable and physically rooted.
42
49
  Sessions and AgentRuns retain the compact source/version/inventory pointers;
43
- file bodies stay in the package. Changing a source affects a new Session only.
44
- Lost or corrupted packages fail closed rather than being rebuilt from current
45
- sources.
50
+ file bodies stay in the package. These records describe captured source, not
51
+ proof of model loading. Source changes apply to current Skill loading after the
52
+ per-turn version check, including existing Sessions. Lost or corrupted audit
53
+ packages fail explicit historical reads, not current Session admission, and are
54
+ never rebuilt from current sources. The loading change adds no persisted DB
55
+ fields or storage migration; storage remains 1.6.
46
56
 
47
57
  Yui 1.0.0 starts from one clean persistent contract. The package version,
48
58
  storage schema, record envelopes and Controller protocol are separate
@@ -2,7 +2,12 @@
2
2
 
3
3
  # 存储基线 1.0
4
4
 
5
- 当前存储为 1.5。已声明的 1.3 → 1.4 迁移为正式项目知识增加适用信息和精确版本历史,
5
+ 当前存储为 1.7。1.6 → 1.7 为规范 Message 和 Leader wake 增加可选的 Agent
6
+ 信箱领取、确认消费回执及精确待处理窗口身份;不改写历史原文或冻结 Context 摘要,
7
+ 不将缺失的处理证据补写成投递或消费。物理 SQL 结构不变。
8
+
9
+ 1.5 → 1.6 增加可选的来源归属费用证据,缺失费用仍保持未知。
10
+ 已声明的 1.3 → 1.4 迁移为正式项目知识增加适用信息和精确版本历史,
6
11
  并将提案指纹扩展到适用范围、失效条件及替代意图。仅从精确匹配的已接受提案恢复
7
12
  `scope`/`expiresWhen`;存量知识以已观察到的当前内容建立版本 1,不臆造缺失的修改历史。
8
13
  已有提案的身份、审批和来源保留,冻结的 Context 快照及摘要不改写。物理 SQL 结构不变。
@@ -13,16 +18,17 @@
13
18
  1.4 → 1.5 在现有 effective launch 和 Session
14
19
  Manifest 中新增完整 Skill 包引用,不改 SQL 布局。历史记录与摘要原样保留;
15
20
  缺少包元数据明确表示旧版只记录入口正文或没有装载证据,不能拿当前源目录
16
- 补造历史版本。运行中的旧 Host 保留原输入;恢复缺少包快照的旧 Session 时
17
- 会给出需要显式创建新 Session 的诊断,不在普通读取中迁移或回填。
21
+ 补造历史版本。运行中的旧 Host 保留原输入;当前加载使用稳定源入口与内部版本,
22
+ 合法旧 Session 恢复不再要求历史冻结包或更换 Session,不在普通读取中迁移或回填。
18
23
 
19
24
  新 Session 将资源保存到 `runtime/skill-packages/<digest>`,摘要覆盖排序后的
20
25
  相对路径、原始文件字节摘要、大小与可执行标志。内置 Skills 共享完整兄弟目录,
21
26
  保留跨 Role 相对引用;自定义 Skill 限于其自身目录。拒绝符号链接、特殊文件,
22
27
  以及超过 2,048 个文件、单文件 8 MiB、总计 32 MiB 或 32 层目录的包。
23
28
  脚本只保存,不因装载而执行。Session、AgentRun、CLI 和 Web 复用精简来源、
24
- 版本与资源清单引用,不复制大文件正文。源更新只影响新 Session;快照丢失或
25
- 损坏明确报错,不从当前源目录重建。
29
+ 版本与资源清单引用,不复制大文件正文。这些是源快照而非模型已读证明。源更新可在
30
+ 现有 Session 的每轮版本检查后采用。快照丢失或损坏只使历史读取明确报错,不再作为
31
+ 当前会话准入门槛,也不从当前源目录重建。本次加载契约不改 DB 字段,存储仍为 1.6。
26
32
 
27
33
  Yui 1.0.0 从唯一、纯净的持久化契约开始。软件包版本、存储结构、记录封装和
28
34
  Controller 协议是相互独立的身份,不能从其中一个推断另一个。
@@ -253,10 +253,11 @@ External-effect authorization must be explicit: development does not grant
253
253
  push/PR/merge, and merge does not grant release, production update or archive.
254
254
 
255
255
  When the user explicitly requests further implementation or delivery of the same
256
- completed, unarchived result, the Operator may perform the necessary
257
- `task reopen <task>` before submitting the new scoped request. The user need not
258
- add a mechanical “reopen” confirmation. These existing operations suffice; no
259
- auto-reopen option or post-completion execution protocol is needed. Ordinary
256
+ completed, unarchived result, the current matching Leader may perform the necessary
257
+ `task reopen <task>` for its own Task and continue that bounded request; Operator
258
+ handoff is not mandatory. The Operator may still reopen before routing new input.
259
+ Neither path needs a mechanical “reopen” confirmation. These existing operations
260
+ suffice; no auto-reopen option or post-completion execution protocol is needed. Ordinary
260
261
  send/queue/submit, including `--intent develop`, still refuses a completed Task
261
262
  before saving new input. Queries, record-only input and discussion do not grant
262
263
  reopening authority.
@@ -266,10 +267,14 @@ preserving original events, fixed heads/reports and Publication history. The
266
267
  Leader separately verifies and accepts the new result; old validation does not
267
268
  automatically cover it. Reopen preserves an independent execution stop: only the
268
269
  authorized `task execution start` path can lift that gate after cleanup.
269
- Cancelled intent requires separate restoration authority; archived Tasks cannot
270
- reopen, and retained workspaces or Session replacement do not bypass lifecycle.
271
-
272
- Reopening and submitting are two atomic operations with separate outcomes.
270
+ Cancelled/retired intent requires separate explicit user/Operator restoration
271
+ authority and cannot be restored by the Leader; archived Tasks cannot reopen,
272
+ and retained workspaces or Session replacement do not bypass lifecycle.
273
+ Delivery still requires the current Session's delivery authority and legal
274
+ workspace; reopening does not promote a planning Session or expand write scope.
275
+
276
+ For routed input, reopening and submitting are two atomic operations with
277
+ separate outcomes.
273
278
  Inspect the lifecycle result and saved/queued receipt; if submission fails,
274
279
  read current state and continue only the unapplied step within the same authority.
275
280
  Keep the same key for a matching submission retry, never replay unknown effects,
@@ -277,6 +282,10 @@ and do not reopen again merely to retry after another completion or cancellation
277
282
  The reopen notification can arrive before the new Message: the Leader waits for
278
283
  the actual request, without rerunning accepted work or immediately completing
279
284
  again. Once the request arrives, it proceeds without another “continue.”
285
+ When the Leader already has the new request, it uses that original input after
286
+ reopening rather than resubmitting or creating a self-wake. Preserve a direct
287
+ conversation's request and boundaries in Task records without impersonating
288
+ user/Operator input.
280
289
 
281
290
  Publication upsert, diff/adopt and verify remain separate, authorized atomic
282
291
  operations for completed, unarchived results. They need no reopening when no new
@@ -194,8 +194,10 @@ CLI、当前 Leader Context 和 Web 从同一组事实推导覆盖,不联网
194
194
  WorkItem/ReviewRound Assignment。外部效果必须明确获授权:开发不授予
195
195
  push/PR/merge,合并不授予发版、生产升级或归档。
196
196
 
197
- 用户明确要求继续同一个已完成、未归档成果的实现或交付时,Operator 可以先执行必要的
198
- `task reopen <task>`,再提交这次有界请求。用户无需机械地额外确认“重开”。
197
+ 用户明确要求继续同一个已完成、未归档成果的实现或交付时,当前有效且匹配该 Task 的
198
+ Leader 可以自行执行 `task reopen <task>`,重开自己的任务并继续这次有界请求,
199
+ 不必转交 Operator。Operator 仍可在路由新输入前重开。两条路径都无需用户机械地
200
+ 额外确认“重开”。
199
201
  现有两步即可满足目标,不需要自动重开开关或后完成执行协议。普通 send/queue/submit
200
202
  (包括 `--intent develop`)仍会在保存新输入前拒绝 completed Task;只读查询、
201
203
  record-only 输入和讨论本身不授予重开权限。
@@ -203,14 +205,18 @@ record-only 输入和讨论本身不授予重开权限。
203
205
  重开回到 active,撤下当前完成元数据,同时保留原事件、固定 head/报告和 Publication
204
206
  历史。Leader 对新结果单独验证与验收,不能把旧验证直接宣称为新结果的证据。
205
207
  重开保留独立的执行停止决定;只有获授权且完成清理的 `task execution start` 路径
206
- 可以解除 gate。恢复 cancelled 意图需要单独明确授权;archived Task 不能重开,
207
- 保留工作区或 Session 替换都不能绕过生命周期。
208
+ 可以解除 gate。恢复 cancelled/retired 意图需要单独明确授权并由 user/Operator 执行,
209
+ Leader 不能自行恢复;archived Task 不能重开,保留工作区或 Session 替换都不能绕过生命周期。
210
+ 交付仍要求当前 Session 的 delivery 权限和合法工作区;重开不会把 planning Session
211
+ 升级为交付 Session,也不扩大写入范围。
208
212
 
209
- 重开与提交是两个有独立结果的原子操作。分别检查生命周期结果和 saved/queued 回执;
213
+ 路由新输入时,重开与提交是两个有独立结果的原子操作。分别检查生命周期结果和 saved/queued 回执;
210
214
  提交失败时读取当前状态,仅在权限未变时继续尚未生效的那一步。相同提交重试保留原 key,
211
215
  不重放效果未知的操作,也不因重试而再次重开已经重新完成或取消的 Task。
212
216
  重开通知可能先于新 Message 到达:Leader 等待具体新请求,不重跑已验收工作,
213
217
  也不立即再次 complete;请求到达后不再要求额外“继续”。
218
+ Leader 已收到新请求时,重开后使用该原始输入,不重新提交或制造 self-wake。
219
+ 直接对话中的请求及边界按需保存在 Task 记录中,不冒充 user/Operator 输入。
214
220
 
215
221
  Publication upsert、diff/adopt、verify 仍是未归档已完成成果的独立授权原子操作,
216
222
  没有新执行请求时不必重开。重开后的工作记录自己的新完成证据,不改写旧基线,
@@ -50,12 +50,12 @@ is required.
50
50
  ## Permanent core smoke
51
51
 
52
52
  `npm test` and `npm run test:core` build the checkout and run the maintained suite.
53
- The stable suite owns current storage 1.6 and its declared 1.0/1.1/1.2/1.3/1.4/1.5 minor
53
+ The stable suite owns current storage 1.7 and its declared 1.0/1.1/1.2/1.3/1.4/1.5/1.6 minor
54
54
  transition. It contains no undeclared historical format compatibility path.
55
55
 
56
56
  Current coverage includes:
57
57
 
58
- 1. Fresh storage 1.6, exact schema/record validation, no initialization over
58
+ 1. Fresh storage 1.7, exact schema/record validation, no initialization over
59
59
  unknown data, and rejection of old integer formats without mutation.
60
60
  2. Exact-version staging, mismatched-target refusal, same-major contiguous
61
61
  minor preflight, explicit maintenance-owner identity across handover, and
@@ -86,6 +86,12 @@ a blacklist of retired field names.
86
86
  ## Skill and instruction changes
87
87
 
88
88
  Review the shared Runtime contract and affected Role/Project Skills together.
89
+ Managed Skills ship a separate integer `VERSION`; bump the owning version for
90
+ substantive body or required-reference changes. The per-turn read reports current
91
+ stable paths/versions, not remembered model state or a historical load receipt.
92
+ Regressions cover pre-1.5 Session records upgraded from an isolated 1.4 Home,
93
+ current Skill loading on resume, preserved original queued input and newly
94
+ arriving suffixes, plus missing current files versus missing audit packages.
89
95
  Check instruction boundaries with a few relevant scenarios: analysis remains
90
96
  read-only, existing mechanisms are reused, Session loss preserves Task intent,
91
97
  and execution failure does not prevent authorized supervision. This is a
@@ -120,6 +126,13 @@ freshly installed package through
120
126
  artifact and provenance boundaries. This validates runtime integration, not
121
127
  real-model behavior. Pure contract and safety tests remain in `test/core`;
122
128
  production wiring is exercised here rather than only through mocked ports.
129
+ The same release matrix runs `test/core/sqlite-driver.test.js` against the
130
+ installed consumer: native selection boundaries plus real SQL, transactions,
131
+ JSON/RETURNING, WAL and backup for each usable optional SQLite candidate.
132
+ An unavailable optional candidate is explicitly skipped, not reported as
133
+ compatible; the normal selected-driver path must still pass. Doctor smoke
134
+ reports the selected driver, engine and fallback reason. This matrix does not
135
+ prove old-glibc compatibility.
123
136
  The native dependency check launches a fixed local program through PTY and
124
137
  requires its output and normal exit. Installed-package smoke explicitly checks
125
138
  default Doctor's PTY results using dependencies resolved from the consumer.
@@ -132,8 +145,13 @@ The package smoke also checks unconditional status identity and update-owned
132
145
  resource/identity capture through the assembled package. Real lifecycle children
133
146
  stop the exact Controller and restore its captured launch identity while their
134
147
  parent holds the handover lock. Unrelated callers remain fenced, the lock stays
135
- owned by the parent, and durable input survives. These checks have no installation
136
- or publication effect.
148
+ owned by the parent, and durable input survives. A live Operator Host also spans
149
+ that replacement: a Desktop-direct terminal is persisted during Controller
150
+ downtime, then the successor drains the queued user input and engineering notice
151
+ without changing their original identities or replacing the Host. This is a
152
+ current-contract process-handover regression, not proof of compatibility with
153
+ every historical Host build. These checks have no installation or publication
154
+ effect.
137
155
 
138
156
  Configured Agents acting as developers or reviewers are ordinary execution
139
157
  resources. Using a live provider or model as the subject of validation is
@@ -87,6 +87,10 @@ setup、输入跨重启持久化及幂等、scratch 激活、原生结果入库
87
87
  npm bin、依赖、受支持 Node 版本、产物和 provenance 边界。这证明运行时集成,不证明
88
88
  真实模型行为。纯契约与安全检查保留在 `test/core`,生产组件组装在这里验证,
89
89
  不只依赖模拟端口。
90
+ 同一发布矩阵还针对消费者安装包运行 `test/core/sqlite-driver.test.js`,验证原生
91
+ 选择边界,并对每个可用的可选 SQLite 候选执行真实 SQL、事务、JSON/RETURNING、
92
+ WAL 和备份检查。不可用候选会明确标记跳过,不视为兼容;正常选择路径仍必须通过。
93
+ Doctor 冒烟报告选中的驱动、引擎和回退原因。该矩阵不能证明旧 glibc 环境兼容。
90
94
  原生依赖检查必须通过 PTY 启动固定本地程序,确认输出和正常退出。安装包 smoke
91
95
  明确断言默认 Doctor 的 PTY 检查成功,并从消费者安装目录解析依赖。macOS 还会
92
96
  在可丢弃的依赖副本中移除 spawn-helper 执行权限,验证 Doctor 报出实际 helper
@@ -95,7 +99,10 @@ npm bin、依赖、受支持 Node 版本、产物和 provenance 边界。这证
95
99
  这不是整个 Doctor 一秒内返回的保证。
96
100
  组装包检查还验证固定身份输出,以及升级侧通过组装包采集资源和精确 Controller 身份,
97
101
  并在父进程持有交接锁时,通过真实生命周期子进程停止精确 Controller、恢复其已捕获的
98
- 启动身份。无关调用仍被锁阻止,锁保持由父进程持有,持久输入不变;
102
+ 启动身份。无关调用仍被锁阻止,锁保持由父进程持有,持久输入不变。
103
+ 同一个存活 Operator Host 跨越交接:在 Controller 停机期间持久保存 Desktop
104
+ 直接回合的终态,随后由新 Controller 推进排队的用户输入和工程通知,保留原始输入身份,
105
+ 不替换 Host。这是当前契约下的进程交接回归,不证明所有历史 Host 实现都兼容;
99
106
  这些检查不执行安装或发布效果。
100
107
 
101
108
  作为开发者或审查者的已配置 Agent 是普通执行资源。把一个真实 provider 或模型作为验证
@@ -56,6 +56,25 @@ Claude 自身的 key 确认、目录信任等交互仍可能需要你完成。
56
56
  npm install -g @zq-silk/yui
57
57
  ```
58
58
 
59
+ 打开真实 Home 前,Yui 会惰性选择 SQLite:先用 `sqlite-modern`
60
+ (`better-sqlite3@13.0.3`,N-API)建立可丢弃的内存连接,仅在明确的原生绑定缺失、
61
+ Node ABI 或系统动态库不兼容时尝试 `sqlite-compat`(`better-sqlite3@10.1.0`)。
62
+ 每个进程固定首次成功的选择;Home 权限、损坏、锁定、SQL 与迁移错误都不会
63
+ 触发驱动切换。`yui doctor` 单独报告驱动版本、实际 SQLite 引擎和回退原因,
64
+ 与 Home 健康检查区分。
65
+
66
+ N-API 驱动避开了旧驱动在 Node 24.19/24.20 上的原生 `ObjectWrap` 垃圾回收崩溃。
67
+ 它要求 Node-API 10;旧 API 的运行时(包括 Node 20 与 Node 22.9)会在加载
68
+ 原生模块前跳过它,使用兼容候选。此依赖修正不要求更换
69
+ 全局 Node 或迁移 Home。
70
+
71
+ npm 安装时会**分别尝试两个**固定 optional alias,并非新版失败后才安装旧版,
72
+ 因此下载体积、安装和编译时间可能增加。可选依赖安装失败不一定使 npm 失败,
73
+ 但两个候选都不可用时 Yui 仍无法运行;不要使用 `--omit=optional`。
74
+ 兼容驱动使用旧 SQLite(3.46.0),不包含后续修复,也不保证兼容任意旧 glibc、
75
+ 编译器或较新的 Node ABI。上述 Node 支持范围不变;仍可能需要升级系统或工具链。
76
+ 驱动选择不会降级或迁移 Home 数据。
77
+
59
78
  ### 2. 自己初始化,或交给 Agent
60
79
 
61
80
  在终端中运行交互式初始化:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "2.6.0",
3
+ "version": "2.7.1",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -48,9 +48,12 @@
48
48
  "dependencies": {
49
49
  "@xterm/addon-fit": "^0.11.0",
50
50
  "@xterm/xterm": "^6.0.0",
51
- "better-sqlite3": "^12.11.1",
52
51
  "node-pty": "1.2.0-beta.15",
53
52
  "smol-toml": "1.8.0",
54
53
  "ws": "^8.21.1"
54
+ },
55
+ "optionalDependencies": {
56
+ "sqlite-modern": "npm:better-sqlite3@13.0.3",
57
+ "sqlite-compat": "npm:better-sqlite3@10.1.0"
55
58
  }
56
59
  }
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: yui-leader
3
- description: Lead one Yui Task through authorized planning, activation handoff, execution and acceptance, choosing responsibilities and a useful stopping point from its current stage and user intent.
3
+ description: Lead one Yui Task through authorized planning, activation handoff, execution, acceptance and same-result follow-up, including reopening its completed, unarchived result for an explicit implementation or delivery request.
4
4
  ---
5
5
 
6
6
  # Yui Leader
7
7
 
8
- Follow [yui-runtime](../yui-runtime/SKILL.md) first. Load the exact Context Pack
8
+ Follow [yui-runtime](../yui-runtime/SKILL.md) first, including its lightweight
9
+ `yui session skills --json` check at the start of every turn and full reload when
10
+ versions change or context is missing/recovered. Load the exact Context Pack
9
11
  for an explicitly dispatched AgentRun; for direct conversation or a Task
10
12
  notification, read current Task context using `yui task context <task-id> --json`.
11
13
  No self-dispatch or old completed Run is needed. Read the actual Task
@@ -54,15 +56,22 @@ or planning work; the routes below do not override those restrictions.
54
56
  even on an active Task. Do not turn it into edits or dispatch. A result
55
57
  notification is different: read its original results and advance the
56
58
  outstanding authorized requirement.
57
- - **Completed, cancelled, retired or archived, or execution gate disabled:**
58
- explain/query authorized facts only unless a specific further action has
59
- been authorized and is legal. A conversation does not reopen, reactivate or
60
- resume execution. If new implementation is requested, identify the needed
61
- lifecycle/authority action for the Operator; do not manufacture a Run.
62
- An explicit same-result follow-up on a completed, unarchived Task can authorize
63
- the Operator's necessary reopen and submission without a second mechanical
64
- confirmation. Read the
65
- [post-completion routing boundary](../yui-runtime/references/publication.md#post-completion-routing-boundary).
59
+ - **Completed, unarchived, explicit same-result implementation or delivery request:**
60
+ the current matching Leader may call `task reopen <task-id>` for its own Task,
61
+ then continue that bounded request without a mandatory Operator handoff or
62
+ another “reopen” confirmation. Read the
63
+ [post-completion routing boundary](../yui-runtime/references/publication.md#post-completion-routing-boundary)
64
+ first, inspect the reopen result, and reassess current Session/workspace
65
+ authority and the execution gate before delivery. Reopening is lifecycle
66
+ management, not a planning Session's promotion to delivery.
67
+ - **Cancelled/retired, archived, execution gate disabled, or no new execution authority:**
68
+ explain/query authorized facts only unless a specific further action is
69
+ authorized and legal. The Leader cannot restore cancelled/retired intent;
70
+ archived Tasks cannot reopen. An independent stop needs its separately
71
+ authorized start/cleanup path; reopen does not lift it. Queries, discussion,
72
+ ordinary notifications and Session recovery do not authorize reopening or
73
+ resumption. Identify a genuinely missing lifecycle/authority action for the
74
+ Operator; do not manufacture a Run or reopen merely to obtain authority.
66
75
  Publication recording/adoption is not a way to start terminal-Task execution.
67
76
 
68
77
  These are instruction routes, not new lifecycle states or a scheduling
@@ -82,6 +91,14 @@ the failed target need not be running for you to act.
82
91
 
83
92
  ## Maintain useful durable context
84
93
 
94
+ Apply **yui-runtime**'s own-inbox flow before acceptance or completion and at
95
+ useful work boundaries. A Leader inbox contains its exact notification windows
96
+ and messages for its current managed Assignment, not every Task Message.
97
+ For a window, read its full focused wake and relevant originals; for an
98
+ Assignment message, read its complete original. Dispose of results explicitly,
99
+ then ack the exact entry. Inbox acknowledgement
100
+ never accepts a Candidate or completes the Task.
101
+
85
102
  The DB Brief is the current summary, not a full plan or a history of messages.
86
103
  After meaningful progress, use `task brief update` with only intended fields;
87
104
  read `task event list` before deliberately restoring an older value. Keep
@@ -0,0 +1 @@
1
+ 2
@@ -5,7 +5,8 @@ description: Route requests and follow-up delivery through the owning Task Leade
5
5
 
6
6
  # Yui Operator
7
7
 
8
- Follow [yui-runtime](../yui-runtime/SKILL.md) for the Session's authorized entry. A global Operator reads
8
+ Follow [yui-runtime](../yui-runtime/SKILL.md) for the Session's authorized entry,
9
+ per-turn version/availability check and conditional full reload. A global Operator reads
9
10
  its Global Context without inventing a Task AgentRun. For explicit Task dispatch,
10
11
  load the exact Run Context Pack and preserve its scope and permission boundaries.
11
12
 
@@ -160,7 +161,9 @@ does not establish remote merge.
160
161
  For an explicitly requested continuation of a completed, unarchived result,
161
162
  use the existing `task reopen` then durable submission path. The user's request
162
163
  authorizes the necessary reopening within that scope; do not demand that they
163
- also say “reopen.” Ordinary messages do not auto-reopen a Task. Keep cancelled,
164
+ also say “reopen.” A current matching Leader may also reopen its own Task and
165
+ continue an already-received authorized request; Operator routing is not a
166
+ mandatory handoff. Ordinary messages do not auto-reopen a Task. Keep cancelled,
164
167
  archived and independently stopped execution boundaries separate, and do not
165
168
  use Session recovery to bypass them.
166
169
 
@@ -230,6 +233,11 @@ a dormant Role and verify the complete binding before the next launch.
230
233
 
231
234
  ## Present current progress
232
235
 
236
+ Apply **yui-runtime**'s own-inbox flow at useful routing boundaries and before
237
+ handoff. `yui inbox list/show/claim/ack` processes Operator input in this turn;
238
+ do not wait for another wake or copy pending notices into new input. Read every
239
+ relevant original and finish the authorized routing/disposition before ack.
240
+
233
241
  Use JSON reads and their top-level `data` field.
234
242
  Use Global Context's `pending`/`recent` pages to find Messages, then
235
243
  `role message show operator <id>` for the original. A successful send receipt
@@ -0,0 +1 @@
1
+ 2
@@ -39,6 +39,8 @@ Separate lifecycle, execution gate and Session authority:
39
39
  necessary `task reopen` before submitting that bounded request. Follow the
40
40
  [authorized two-step path](../../yui-runtime/references/publication.md#post-completion-routing-boundary);
41
41
  do not require a second mechanical “reopen” confirmation.
42
+ The current matching Leader may perform that reopen itself and continue
43
+ an already-received request; it need not send the work back to Operator.
42
44
  - Cancelled/retired intent is not active work. An archived Task cannot be reopened;
43
45
  retained workspaces and historical Sessions do not authorize execution.
44
46
  - Session loss or replacement is not a new result or an automatic lifecycle
@@ -5,7 +5,8 @@ description: Review the exact frozen WorkItem Candidate or unified Task-final sc
5
5
 
6
6
  # Yui Reviewer
7
7
 
8
- Follow [yui-runtime](../yui-runtime/SKILL.md) first and load the exact current
8
+ Follow [yui-runtime](../yui-runtime/SKILL.md) first, including its per-turn
9
+ version/availability check and conditional full reload, and load the exact current
9
10
  AgentRun Context Pack. The
10
11
  ReviewRound, Candidate, workspace, and Snapshot digest returned there are the
11
12
  only review scope; fail closed on any mismatch.
@@ -51,6 +52,12 @@ execution a scoped question may be sent with `task message send <task> "<questio
51
52
 
52
53
  ## Separate infrastructure failure from review judgment
53
54
 
55
+ At useful review boundaries and before reporting, apply **yui-runtime**'s
56
+ own-inbox flow for current-ReviewRound clarification. Read complete originals,
57
+ claim before handling, and ack after disposition. These messages supplement
58
+ the frozen pack; they cannot replace its Candidate, expand review scope, or
59
+ turn acknowledgement into a review verdict.
60
+
54
61
  Verify the exact AgentRun identity, Context Pack, frozen head, and ReviewRound-owned
55
62
  workspace before inspecting candidate sources. If context loading or workspace
56
63
  binding fails before review begins:
@@ -0,0 +1 @@
1
+ 2