@zq-silk/yui 2.18.0 → 2.20.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 (36) hide show
  1. package/dist/cli/commandCatalog.js +2 -0
  2. package/dist/commands/controllerCommands.js +1 -0
  3. package/dist/commands/roleConfiguration.js +17 -0
  4. package/dist/controller/controller.js +10 -0
  5. package/dist/controller/fileSchedulerStoreAdapter.js +26 -2
  6. package/dist/controller/messageHealth.js +354 -0
  7. package/dist/controller/runtime.js +9 -1
  8. package/dist/controller/runtimeLaunchCoordinator.js +12 -1
  9. package/dist/controller/taskHostTerminalRecovery.js +11 -0
  10. package/dist/executor/agentExecutor.js +7 -0
  11. package/dist/executor/fileRoleLaunchPlanner.js +22 -6
  12. package/dist/output/rolePresentation.js +1 -0
  13. package/dist/role/instanceCode.js +7 -0
  14. package/dist/role/role.js +10 -0
  15. package/dist/runtime/agentEndpoint.js +1 -0
  16. package/dist/runtime/agentHost.js +9 -1
  17. package/dist/runtime/launchBroker.js +3 -0
  18. package/dist/runtime/runtimeBinding.js +3 -0
  19. package/dist/runtime/sessionTitle.js +29 -9
  20. package/dist/runtime/structuredProviderHost.js +11 -1
  21. package/dist/runtime/tmuxAdapters.js +4 -0
  22. package/dist/storage/contextRecords.js +16 -0
  23. package/dist/storage/sqliteSchema.js +10 -0
  24. package/dist/storage/sqliteStore.js +16 -0
  25. package/dist/storage/storageVersions.js +1 -1
  26. package/docs/managed-turn-and-session-runtime.md +96 -0
  27. package/docs/managed-turn-and-session-runtime.zh-CN.md +65 -0
  28. package/docs/release-workflow.md +49 -0
  29. package/docs/release-workflow.zh-CN.md +37 -0
  30. package/docs/roles-and-configuration.md +49 -0
  31. package/docs/roles-and-configuration.zh-CN.md +38 -0
  32. package/docs/storage-baseline.md +4 -1
  33. package/docs/storage-baseline.zh-CN.md +1 -1
  34. package/docs/testing/verification-levels.md +2 -2
  35. package/docs/testing/verification-levels.zh-CN.md +1 -1
  36. package/package.json +1 -1
@@ -51,6 +51,55 @@ 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.20.0 compatibility and migration notes
55
+
56
+ This minor adds independent optional Role instance codes (`--instance-code` /
57
+ `--clear-instance-code`) and a `Draft` marker for Leader Sessions with planning
58
+ authority. Operator-only configuration does not propagate to Leader or other
59
+ Roles. Task Role template copies remain independent; codes are presentation,
60
+ not identity, authorization or launch-configuration drift. Full lowercase Task
61
+ IDs remain unchanged. See [Role configuration](roles-and-configuration.md).
62
+
63
+ New Sessions use the configured code. Normal Codex Host launches/resumes can refresh
64
+ confirmed Yui-owned titles without forcing a stop/replacement. Historical untagged
65
+ titles and recorded custom names are preserved. Codex resume naming requires
66
+ the native name to match the previous generated title; missing metadata and
67
+ user renames are left untouched. Title provenance advances only after a successful
68
+ native naming receipt, not pre-start registration or live Host reuse. Other
69
+ Providers receive generated names only on creation, never on resume. Provider
70
+ naming remains best effort.
71
+
72
+ Storage advances **1.24 → 1.25** through an additive, no-rewrite transition for
73
+ optional Role code and Session title provenance. Older supported Homes follow
74
+ the centralized contiguous chain; do not open an upgraded Home with older
75
+ software. Controller/Host protocols remain v1. Publication does not authorize
76
+ installing the release, migrating a production Home, restarting shared services,
77
+ replacing Sessions or choosing codes for existing Roles.
78
+
79
+ Release gates require exact-merge Core CI and the same runtime tarball's
80
+ fresh-install matrix before npm `latest` publication. These deterministic
81
+ checks do not establish real-model behavior.
82
+
83
+ ### 2.19.0 compatibility and migration notes
84
+
85
+ This minor adds message backlog and blocked-delivery monitoring with Operator
86
+ alerts (PR #492). Observations distinguish live work, paused execution and bounded
87
+ retry from stalled delivery, retain original evidence, and deduplicate alerts
88
+ across Controller restarts. Alerts include evidence-matched management guidance:
89
+ inspect the exact input and execution first, distinguish rejected retry from
90
+ unknown-result resolution, and require scoped stop proof or explicit replacement
91
+ authority where applicable. Monitoring never retries, stops or replaces execution
92
+ automatically; an alert is not recovery authority or proof of a unique root cause.
93
+
94
+ Storage remains **1.24**, and Controller/Host protocols remain v1. Existing
95
+ messages and events are preserved; this release adds no storage migration.
96
+ Older supported Homes still use the centralized contiguous migration chain.
97
+ With separate update authority, the Operator verifies the published artifact
98
+ then runs `yui update --version 2.19.0`. Compatible live Sessions are retained;
99
+ publishing alone does not update the installed program or recover other Tasks.
100
+ Exact-merge Core CI and the same tarball's fresh-install platform/Node matrix
101
+ remain release gates. These checks do not establish real-model behavior.
102
+
54
103
  ### 2.18.0 compatibility and migration notes
55
104
 
56
105
  This minor includes the already-merged independent Jobs workspace and global
@@ -36,6 +36,43 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
36
36
  不能将不兼容冒称为兼容,也不为回避版本选择新增历史兼容机制。包版本与协议、
37
37
  持久存储契约仍然独立:兼容性检查和必要迁移要求不变,下文存储规则不授予发版权限。
38
38
 
39
+ ### 2.20.0 兼容性及迁移说明
40
+
41
+ 本 minor 增加按 Role 独立可选的实例码(`--instance-code` /
42
+ `--clear-instance-code`),以及持有 planning 权限的 Leader Session 的 `Draft`
43
+ 标识。仅设置 Operator 不会传播到 Leader 或其他 Role;Task Role 模板副本保持
44
+ 独立。实例码仅供展示,不改变身份、权限、启动配置版本或完整小写 Task ID。
45
+ 详见 [Role 配置](roles-and-configuration.zh-CN.md)。
46
+
47
+ 新会话采用配置,正常 Codex Host 启动/恢复可刷新确认由 Yui 管理的标题,不强停或替换会话。
48
+ 旧的无来源标记标题和已记录的用户标题保留。Codex 恢复时仅在原生名字仍匹配上次
49
+ 生成标题时改名;原生信息缺失或用户已改名则跳过。标题来源仅在原生命名成功回执后
50
+ 推进,不因预启动登记或存活 Host 复用而变化。其他 Provider 仅在新建时传入生成名,
51
+ 恢复时不传入。Provider 命名仍为尽力能力。
52
+
53
+ 存储通过中央连续迁移从 **1.24 → 1.25**,只增加可选实例码和标题来源,
54
+ 不改写历史记录。较早的受支持 Home 沿既有迁移链升级,不可用旧程序打开升级后的
55
+ Home。Controller/Host 协议仍为 v1。发布不授权安装升级、迁移生产 Home、
56
+ 重启共享服务、替换会话或为现有 Role 选择实例码。
57
+
58
+ 发布门禁要求准确合入 commit 的 Core CI 和同一 runtime tarball 的全平台
59
+ fresh-install 矩阵通过后才向 npm `latest` 发布;这些确定性验证不证明真实模型行为。
60
+
61
+ ### 2.19.0 兼容性及迁移说明
62
+
63
+ 本 minor 新增消息积压、投递阻塞监测及 Operator 告警(PR #492)。观测区分正常执行、
64
+ 暂停、有界重试与投递停滞,保留原始证据,并跨 Controller 重启去重告警。
65
+ 告警包含按证据匹配的管理恢复引导:先检查精确输入和执行状态,区分明确拒绝后的
66
+ retry 与未知结果的 resolve,并在需要时要求精确停止证明或显式替换授权。
67
+ 监测不会自动重试、停止或替换执行;告警本身不是恢复授权,也不证明唯一根因。
68
+
69
+ 存储仍为 **1.24**,Controller/Host 协议仍为 v1。已有消息与事件保留,本版本
70
+ 不新增存储迁移;较早受支持 Home 仍通过集中式连续迁移链升级。
71
+ 另行获得更新授权后,由 Operator 核验实际发布包,再执行
72
+ `yui update --version 2.19.0`。兼容的存活 Session 保留;发布本身不更新运行安装,
73
+ 也不恢复其他 Task。精确 merge commit 的 Core CI 与同一 tarball 的全新安装
74
+ 平台/Node 矩阵仍为发布门禁,这些验证不代表真实模型行为验证。
75
+
39
76
  ### 2.18.0 兼容性及迁移说明
40
77
 
41
78
  本 minor 包含已合入的独立 Jobs 工作区和全局 Shell 脚本 Job(PR #490),以及
@@ -18,6 +18,55 @@ requiring a same-named global Role. A global Role is a creation template only
18
18
  when the requested Task Role does not exist. Availability, producer separation
19
19
  and the frozen review candidate still apply.
20
20
 
21
+ ## Optional instance codes and Session titles
22
+
23
+ Each Role can independently set a display-only instance code. For example,
24
+ configure only Operator, leaving Leader and all other Roles unset:
25
+
26
+ ```sh
27
+ yui config role update operator --instance-code dev-bj
28
+ yui config role show operator
29
+ yui config role update operator --clear-instance-code
30
+ yui task role update task-159 leader --instance-code dev-sg
31
+ ```
32
+
33
+ `add` also accepts `--instance-code`. Codes accept 1–24 UTF-16 units of Unicode
34
+ letters, numbers, combining marks, hyphen and underscore; omit `@`. Whitespace,
35
+ controls, escapes and punctuation are rejected, not silently normalized.
36
+ There is no Home-wide fallback. A Global Role's code is copied when that template
37
+ creates a Task Role; later template changes do not rewrite the copy. Agent
38
+ Profiles do not supply display codes. Use Task Role update/clear for an existing
39
+ copy. Codes do not alter launch revisions, permissions, IDs or message routing.
40
+ Choose recognizable values; codes are not globally unique identities. Use
41
+ Session inspection and the actual Home/native identity when resolving ambiguity.
42
+
43
+ Generated Task titles use `Yui Leader task-159 Draft @dev-sg · Task name`.
44
+ `Draft` means the Leader Session has planning authority, including a retained
45
+ planning Session after activation; delivery Sessions omit it. Other Role names
46
+ and the full lowercase Task ID remain intact. Operator uses
47
+ `Yui Operator @dev-bj · MMDD`; without a code its existing
48
+ `Yui · Operator · MMDD` format remains. The date derives from Session creation
49
+ and the configured timezone. Other Global Roles get a generated title when a
50
+ code is configured. Descriptions are truncated first without splitting surrogate
51
+ pairs; if the identity itself cannot fit the 80-unit title limit, launch fails
52
+ with a bounded diagnostic instead of truncating the identity.
53
+
54
+ Configuration does not rename, stop or recreate a live Session. New Sessions
55
+ use it; a subsequent normal Host launch/resume can refresh confirmed Yui-owned titles,
56
+ not historical records. Existing untagged titles and recorded user names stay
57
+ untouched. Codex applies a resume rename only when its returned native name still
58
+ matches the previous generated title; absent metadata or a user rename prevents
59
+ the rename. Codex records only successfully applied names; live Host reuse,
60
+ skipped naming and naming failures do not advance title provenance. Naming is
61
+ best effort; unsupported Providers or failures do not invalidate the Session.
62
+ Other Providers receive generated names only on creation, never on resume,
63
+ to protect native user renames. No restart is performed to force a naming change.
64
+ On the safe Codex resume path, clearing a custom Global Role's code restores
65
+ `Yui role`; clearing Operator's code restores its unconfigured format.
66
+
67
+ Storage 1.24 → 1.25 adds optional code/title provenance without rewriting
68
+ historical payloads or inferring who named an old Session.
69
+
21
70
  ## Enable and disable
22
71
 
23
72
  Availability is configuration, separate from active Agent selection, Session
@@ -15,6 +15,44 @@ Task Role 是 Task 局部的;global Role 提供已配置的默认值和全局
15
15
  的 global Role。只有当请求的 Task Role 不存在时,global Role 才作为创建模板。
16
16
  可用性、producer 分离和冻结的审查候选仍然适用。
17
17
 
18
+ ## 可选实例码与会话标题
19
+
20
+ 每个 Role 独立配置仅用于展示的实例码。例如只设置 Operator,其他角色留空:
21
+
22
+ ```sh
23
+ yui config role update operator --instance-code dev-bj
24
+ yui config role show operator
25
+ yui config role update operator --clear-instance-code
26
+ yui task role update task-159 leader --instance-code dev-sg
27
+ ```
28
+
29
+ `add` 也接受 `--instance-code`。允许 1–24 个 UTF-16 单位的 Unicode 字母、
30
+ 数字、组合标记、短横线和下划线,不输入 `@`。空白、控制字符、转义和其他标点
31
+ 直接拒绝,不静默清洗。没有 Home 级默认值;Global Role 作为模板创建 Task Role
32
+ 时复制其值,之后模板变化不回写。Agent Profile 不携带实例码;既有 Task Role
33
+ 通过自己的 update/clear 修改。实例码不改变启动版本、权限、内部 ID 或消息寻址,
34
+ 也不保证全局唯一;遇到歧义应查看实际 Home、Session 和原生身份。
35
+
36
+ 生成的 Task 标题为 `Yui Leader task-159 Draft @dev-sg · 任务名`。
37
+ `Draft` 根据 Leader Session 的 planning 权限显示;Task 激活后保留的 planning
38
+ 会话仍显示 Draft,delivery 会话不显示。保留完整小写 Task ID。
39
+ Operator 为 `Yui Operator @dev-bj · MMDD`;未配置保持
40
+ `Yui · Operator · MMDD`,日期使用会话创建时间和配置时区。
41
+ 其他 Global Role 配置实例码后生成标题。80 单位总长度内优先截断任务名,
42
+ 不拆开代理对;身份部分无法容纳则明确报错,不静默截断。
43
+
44
+ 配置修改不会立即重命名、停止或重建活动会话。新会话采用新配置,后续正常
45
+ Host 启动/恢复可刷新确认由 Yui 管理的标题,不改写历史记录。
46
+ 缺少来源标记的旧标题及已记录的用户标题保留。Codex 恢复时只有原生返回的
47
+ 名字仍等于上次生成标题才改名;原生信息缺失或用户已改名则跳过。
48
+ Codex 只记录已成功应用的名称;复用存活 Host、命名失败或跳过不推进标题来源。
49
+ Provider 命名为尽力能力;失败或不支持不会使会话失效。其他 Provider 仅在新建时
50
+ 传入生成名,恢复时不重新传入名称,以保护原生用户改名;不为改名主动重启。
51
+ 在可安全改名的 Codex 恢复路径,清除自定义 Global Role 实例码后恢复
52
+ `Yui role`;Operator 恢复未配置格式。
53
+
54
+ 存储 1.24 → 1.25 增加可选实例码和生成标题来源,不回填历史记录或猜测标题所有权。
55
+
18
56
  ## 启用与停用
19
57
 
20
58
  启停是配置状态,与 Active Agent、Session 是否运行和 Task executionGate 分开:
@@ -2,7 +2,10 @@
2
2
 
3
3
  # Storage baseline 1.0
4
4
 
5
- Current storage is 1.24. The 1.23 → 1.24 transition adds transaction-maintained
5
+ Current storage is 1.25. The 1.24 → 1.25 transition admits optional Role
6
+ `instanceCode` and Session `generatedTitle` presentation fields without rewriting
7
+ existing records. Untagged historical titles remain user-owned; no code or
8
+ title provenance is inferred. The 1.23 → 1.24 transition adds transaction-maintained
6
9
  Task read-cache revisions for the scheduler's nine source tables. Inserts,
7
10
  updates and deletions invalidate only the affected Task; rollback also rolls
8
11
  back the token. These tokens are derived cache identities, never Task authority
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 存储基线 1.0
4
4
 
5
- 当前存储为 1.24。1.23 → 1.24 为调度器的九类来源表增加事务维护的 Task 读取缓存修订号。插入、更新和删除只使对应 Task 的缓存失效,回滚同时回滚修订号。该值仅是派生缓存标识,不是 Task 权限或 Home revision CAS 的替代。历史 payload 不变,旧 Task 在首次修改前使用隐含的零修订号。
5
+ 当前存储为 1.25。1.24 → 1.25 增加可选 Role `instanceCode` 和 Session `generatedTitle` 展示字段,不回填历史标题来源或实例码,不改写既有记录。1.23 → 1.24 为调度器的九类来源表增加事务维护的 Task 读取缓存修订号。插入、更新和删除只使对应 Task 的缓存失效,回滚同时回滚修订号。该值仅是派生缓存标识,不是 Task 权限或 Home revision CAS 的替代。历史 payload 不变,旧 Task 在首次修改前使用隐含的零修订号。
6
6
  同时增加两个局部索引,支持按精确运行观测身份查找,不再扫描或反序列化历史观测集合。
7
7
 
8
8
  1.22 → 1.23 新增全局 Shell Job、版本化脚本文件及每次运行的配置快照,不改写已有 Job、计划和历史记录。
@@ -53,12 +53,12 @@ is required.
53
53
  Both include `test/core` and `test/platform`. For an already built checkout,
54
54
  `npm run test:business` runs only `test/core` and `npm run test:platform` runs
55
55
  only `test/platform`; neither rebuilds. CI owns one explicit build per job.
56
- The stable suite owns current storage 1.24 and its declared 1.0 through 1.23 minor
56
+ The stable suite owns current storage 1.25 and its declared 1.0 through 1.24 minor
57
57
  transition. It contains no undeclared historical format compatibility path.
58
58
 
59
59
  Current coverage includes:
60
60
 
61
- 1. Fresh storage 1.24, exact schema/record validation, no initialization over
61
+ 1. Fresh storage 1.25, exact schema/record validation, no initialization over
62
62
  unknown data, and rejection of old integer formats without mutation.
63
63
  2. Exact-version staging, mismatched-target refusal, same-major contiguous
64
64
  minor preflight, explicit maintenance-owner identity across handover, and
@@ -39,7 +39,7 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
39
39
  两者均包含 `test/core` 和 `test/platform`。已构建的 checkout 可分别运行
40
40
  `npm run test:business` 与 `npm run test:platform`,它们不会再次构建。
41
41
  CI 每个作业只显式构建一次。
42
- 稳定套件维护当前存储 1.24 和明确声明的 1.0 至 1.23 连续小版本迁移,
42
+ 稳定套件维护当前存储 1.25 和明确声明的 1.0 至 1.24 连续小版本迁移,
43
43
  不包含未声明的历史格式兼容路径。
44
44
 
45
45
  当前覆盖包括:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "2.18.0",
3
+ "version": "2.20.0",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,