@zq-silk/yui 2.16.0 → 2.18.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 (118) hide show
  1. package/dist/cli/commandCatalog.js +19 -12
  2. package/dist/cli/interactionCandidates.js +20 -5
  3. package/dist/cli/interactionPolicy.js +5 -4
  4. package/dist/cli/roleWizard.js +7 -0
  5. package/dist/commands/controllerCommands.js +13 -4
  6. package/dist/commands/durableJobCommands.js +50 -3
  7. package/dist/commands/globalRoleCommands.js +31 -14
  8. package/dist/commands/inboxCommands.js +1 -0
  9. package/dist/commands/operatorCommands.js +12 -2
  10. package/dist/commands/profileCommands.js +19 -2
  11. package/dist/commands/roleConfiguration.js +3 -0
  12. package/dist/commands/taskCommands.js +16 -0
  13. package/dist/commands/taskRoleRuntimeStatus.js +3 -0
  14. package/dist/controlPlaneCli.js +21 -4
  15. package/dist/controller/agentJobControl.js +9 -1
  16. package/dist/controller/clientRuntime.js +34 -13
  17. package/dist/controller/controller.js +35 -22
  18. package/dist/controller/diagnosticJournal.js +214 -0
  19. package/dist/controller/fileSchedulerStoreAdapter.js +174 -105
  20. package/dist/controller/globalInputDelivery.js +19 -9
  21. package/dist/controller/globalRuntimeAttention.js +11 -3
  22. package/dist/controller/jobControl.js +1 -1
  23. package/dist/controller/jobDefinitionControl.js +24 -13
  24. package/dist/controller/jobSupervisor.js +4 -0
  25. package/dist/controller/providerRetryAdmission.js +9 -0
  26. package/dist/controller/providerRetryDelivery.js +16 -0
  27. package/dist/controller/runtime.js +80 -4
  28. package/dist/controller/runtimeLaunchCoordinator.js +3 -1
  29. package/dist/controller/workerSchedulerStore.js +24 -0
  30. package/dist/core/boundedRpc.js +4 -0
  31. package/dist/core/controllerServer.js +1 -1
  32. package/dist/core/controllerTelemetry.js +92 -19
  33. package/dist/executor/fileRoleLaunchPlanner.js +3 -0
  34. package/dist/job/globalShell.js +51 -0
  35. package/dist/job/jobBusinessResult.js +4 -3
  36. package/dist/job/jobDefinition.js +6 -1
  37. package/dist/job/jobRunner.js +9 -0
  38. package/dist/job/scheduleService.js +2 -0
  39. package/dist/message/globalInboxRecovery.js +30 -19
  40. package/dist/message/globalProviderRetry.js +7 -1
  41. package/dist/message/messageContinuation.js +4 -0
  42. package/dist/output/rolePresentation.js +3 -0
  43. package/dist/profile/agentProfile.js +8 -0
  44. package/dist/profile/agentProfileRuntime.js +16 -1
  45. package/dist/review/reviewDecision.js +6 -0
  46. package/dist/role/availability.js +28 -0
  47. package/dist/role/role.js +6 -0
  48. package/dist/runtime/builtinAgentErrorMappers.js +4 -0
  49. package/dist/runtime/codexNativeAccess.js +21 -4
  50. package/dist/runtime/globalSessionHealth.js +39 -0
  51. package/dist/runtime/tmuxAdapters.js +5 -0
  52. package/dist/scheduler/activeRoleRunDelivery.js +9 -0
  53. package/dist/scheduler/leaderWakeupProcessor.js +8 -1
  54. package/dist/scheduler/roleRunLiveness.js +3 -0
  55. package/dist/scheduler/roleRunStall.js +10 -10
  56. package/dist/storage/persistenceWorker.js +41 -19
  57. package/dist/storage/sqliteSchema.js +43 -9
  58. package/dist/storage/sqliteStore.js +86 -8
  59. package/dist/storage/storageVersions.js +1 -1
  60. package/dist/storage/storeRpc.js +25 -11
  61. package/dist/storage/taskReadRevisionSchema.js +39 -0
  62. package/dist/web/assets/client/app/catalog.js +0 -29
  63. package/dist/web/assets/client/app/jobs.js +115 -0
  64. package/dist/web/assets/client/app/main.js +32 -28
  65. package/dist/web/assets/client/app/manage.js +1 -0
  66. package/dist/web/assets/client/app/settings.js +1 -5
  67. package/dist/web/assets/client/app/taskView.js +7 -11
  68. package/dist/web/assets/client/i18n/en.js +265 -36
  69. package/dist/web/assets/client/i18n/zh-CN.js +264 -35
  70. package/dist/web/assets/client/index.js +4 -0
  71. package/dist/web/assets/client/layout/manageShell.js +61 -15
  72. package/dist/web/assets/client/layout/router.js +2 -1
  73. package/dist/web/assets/client/layout/shortcuts.js +2 -2
  74. package/dist/web/assets/client/layout/workspace.js +99 -112
  75. package/dist/web/assets/client/lib/prefs.js +1 -1
  76. package/dist/web/assets/client/ui/primitives.js +15 -2
  77. package/dist/web/assets/client/views/dock/conversation.js +421 -123
  78. package/dist/web/assets/client/views/dock/session.js +229 -0
  79. package/dist/web/assets/client/views/dock/terminal.js +48 -39
  80. package/dist/web/assets/client/views/jobs.js +1042 -160
  81. package/dist/web/assets/client/views/overview.js +2 -2
  82. package/dist/web/assets/client/views/sidebar.js +3 -0
  83. package/dist/web/assets/client/views/task/page.js +2 -12
  84. package/dist/web/assets/shared/manageNav.js +3 -1
  85. package/dist/web/assets/shell/appRail.js +2 -1
  86. package/dist/web/assets/shell/dock.js +9 -27
  87. package/dist/web/assets/shell/manage.js +7 -2
  88. package/dist/web/assets/shell/models.js +4 -3
  89. package/dist/web/assets/shell/settingsContent.js +0 -3
  90. package/dist/web/assets/shell/sidebar.js +0 -1
  91. package/dist/web/assets/styles/views/conversation.js +96 -17
  92. package/dist/web/assets/styles/views/dock.js +17 -5
  93. package/dist/web/assets/styles/views/jobs.js +301 -12
  94. package/dist/web/assets/styles/views/sidebar.js +1 -2
  95. package/dist/web/assets/styles/views/task.js +1 -2
  96. package/dist/web/assets/styles/views/terminal.js +12 -8
  97. package/dist/web/webConversation.js +1 -0
  98. package/dist/web/webServer.js +28 -1
  99. package/dist/web/webSettings.js +10 -2
  100. package/docs/global-shell-jobs.md +78 -0
  101. package/docs/job-runs.md +6 -3
  102. package/docs/managed-turn-and-session-runtime.md +84 -0
  103. package/docs/managed-turn-and-session-runtime.zh-CN.md +57 -0
  104. package/docs/release-workflow.md +67 -0
  105. package/docs/release-workflow.zh-CN.md +48 -0
  106. package/docs/roles-and-configuration.md +45 -1
  107. package/docs/roles-and-configuration.zh-CN.md +35 -0
  108. package/docs/storage-baseline.md +19 -1
  109. package/docs/storage-baseline.zh-CN.md +10 -1
  110. package/docs/testing/review-evaluation.md +35 -1
  111. package/docs/testing/review-evaluation.zh-CN.md +25 -1
  112. package/docs/testing/verification-levels.md +2 -2
  113. package/docs/testing/verification-levels.zh-CN.md +2 -2
  114. package/package.json +1 -1
  115. package/skills/yui-leader/VERSION +1 -1
  116. package/skills/yui-leader/references/execution.md +19 -8
  117. package/skills/yui-reviewer/SKILL.md +13 -2
  118. package/skills/yui-reviewer/VERSION +1 -1
@@ -11,6 +11,80 @@ notifications cannot restart an explicitly stopped Session; normal Host detach
11
11
  preserves an active Session and remains reconnectable. A switch after a partial
12
12
  failure still settles the retained input before selecting a new conversation.
13
13
 
14
+ Local stop waits for its durable cleanup obligation, not for the Home-wide
15
+ `scheduler.scan` loop to empty. A signal only requests reconciliation; the
16
+ existing physical-stop proof and cleanup transaction remain the completion
17
+ boundary. A timeout retains the obligation and blocks replacement. Selection
18
+ failure and unconfirmed startup are reported separately; neither permits
19
+ replaying an uncertain native operation.
20
+
21
+ `operator status` and Session context distinguish desired/effective launch
22
+ revisions and selected-writer state from Host observation health. Old-conversation
23
+ failures remain audit evidence, not the new Session's current failure.
24
+ An exact rejected input can be explicitly retired when obsolete; accepted,
25
+ submitting, unknown and interrupt-owned input still retain their handling path.
26
+
27
+ `controller status --json` exposes bounded observations under
28
+ `identity.runtime.observations`: authenticated requests, scheduler pending
29
+ scopes, phase/read costs and sampled event-loop lag are separate facts.
30
+ Samples use a process-monotonic clock and hashed target/request labels, with
31
+ at most 16 recent and 16 active samples plus the slowest completed sample.
32
+ In-flight request count is not queue depth, and pre-routing wait is not
33
+ measured. These observations neither identify an old incident retroactively
34
+ nor establish quiescence; restarting a Controller does not refresh live Hosts.
35
+
36
+ `observations.persistence` separates main-thread database lock/body/commit
37
+ costs from persistence-worker round trips, worker execution and worker reads.
38
+ Worker summaries travel on existing replies and retain a worker-instance ID;
39
+ status reads only cached facts, never performs a diagnostic worker RPC.
40
+ Match hashed request targets when comparing round trip and execution. The
41
+ difference includes startup, queueing, transport and main-loop delay, not a
42
+ pure queue-time measurement. Nested database/read durations overlap worker
43
+ execution and must not be added to it. Historical maxima may belong to other
44
+ requests; the latest/slowest samples retain their own timestamps.
45
+
46
+ With the default persistence worker, periodic Project-sync configuration checks,
47
+ expired Input recommendations and run-progress/stall diagnostic transactions
48
+ execute on that worker as complete read/check/write operations. Their callers
49
+ await completion; lock waiting does not block the socket thread. Existing
50
+ transaction fences and idempotent folds remain unchanged. Explicit worker-off
51
+ mode and injected adapters retain synchronous behavior. This is not blanket
52
+ isolation of all database writes: launch admission, mailbox claims, due Job
53
+ admission and other lifecycle writes still require their own boundary analysis.
54
+ Status responsiveness during these maintenance operations is not proof that
55
+ every possible Controller stall has been eliminated.
56
+
57
+ Idle Global inbox recovery and already-settled retry checks use read-only
58
+ snapshots, without reserving SQLite's writer. Creating a recovery notice or
59
+ settling an outstanding retry still rechecks the current Session/claim/input
60
+ inside the original write transaction. This removes no-op lock waits, not
61
+ contention from actual writes.
62
+
63
+ Production Controller startup (including handover promotion) retains operational
64
+ diagnostics in `runtime/controller-diagnostics.jsonl`, with two rotated files.
65
+ Each file is bounded to 1 MiB and owner-readable/writable only. An asynchronous
66
+ writer admits at most 32 queued records (16 KiB each); it never writes the
67
+ business database. Scheduler/startup errors retain a classification, fingerprint
68
+ and build-relative source frames, not raw messages, arguments or credentials.
69
+ A 250 ms memory-only sampler records new failed/slow observations (at least
70
+ 1 second), active slow work or its own loop delay at most once per second.
71
+ Records carry wall time, monotonic time, PID, process-instance ID and version;
72
+ bounded phase snapshots retain hashed request/target identities. It is sampled
73
+ evidence, not a trace of every request or the exact cause of pre-routing delay.
74
+ `observations.diagnostics` reports written/dropped/pending records and write
75
+ failures. No successful diagnostic write is assumed when storage fails.
76
+ Rotation, queue overflow and abrupt termination can lose evidence; a blocked
77
+ loop cannot emit a snapshot until it resumes. No automatic restart or operation
78
+ replay is introduced. These disposable operational logs are not Task state,
79
+ acceptance, a second recovery authority or a Home schema migration.
80
+
81
+ Scheduler caches load families lazily and use transaction-maintained Task
82
+ read revisions. Another Task or Global message does not invalidate an unchanged
83
+ Task history; updates, deletions and external writers still do. Compound folds
84
+ pin a read snapshot, uncommitted writes cannot publish a reusable cache token,
85
+ and only 16 recent Task projections are retained. Cache entries never authorize
86
+ dispatch or replace exact mutation-time checks.
87
+
14
88
  A newly created global Operator conversation requests the native title
15
89
  `Yui · Operator · MMdd`, using Yui's configured time zone. The request is made
16
90
  only after the provider returns the exact new conversation identity; restore
@@ -526,6 +600,16 @@ conversation unrecoverable. The request is legal while an AgentRun is active,
526
600
  the Session is ended, or previous cleanup is pending. A Leader may also request
527
601
  its own replacement and end its current turn.
528
602
 
603
+ For a Draft Leader whose planning Run has already ended, the replacement
604
+ initialization notification admits the selected fresh Session after confirmed
605
+ cleanup. It does not create another business Run, activate the Task, or adopt a
606
+ delivery workspace: the successor retains planning-only authority and reads
607
+ current Task context and retained inbox originals before handling them. Ordinary
608
+ Draft notifications and unscoped native hooks cannot use this admission.
609
+ A rejected startup retains the notification for explicit `task wake retry`
610
+ after correction, or another legal Session replacement; unknown input acceptance
611
+ never becomes permission to replay.
612
+
529
613
  `task role session stop` can also stop a running Role without first changing
530
614
  its Run status. It retains the native conversation for possible reuse. Pending
531
615
  Messages remain intent and may start a continuation after the stop; use Task
@@ -2,6 +2,57 @@
2
2
 
3
3
  # Session、AgentRun 与通知
4
4
 
5
+ 局部停止等待自身的持久清理义务完成,不等待整个 Home 的 `scheduler.scan`
6
+ 循环排空。signal 只请求调度;完成仍以现有物理停止证明及清理事务为准。
7
+ 超时保留义务并阻止替换;选择失败和新会话启动未确认分别报告,不允许重放未知效果。
8
+
9
+ `operator status` 与 Session context 区分 desired/effective 配置版本、选定写入者
10
+ 状态和 Host 观测健康。旧会话失败保留为审计证据,不是新会话的当前失败。
11
+ 明确 rejected 的过时输入可以显式退役;accepted、submitting、unknown 和
12
+ interrupt-owned 输入仍保留原处理路径。
13
+
14
+ `controller status --json` 的 `identity.runtime.observations` 分别呈现已认证请求、
15
+ 调度待处理范围、阶段/读取成本及采样的事件循环延迟。样本使用进程单调时钟,
16
+ 目标/请求标签仅保存哈希;每组最多保留 16 个近期样本、16 个活动样本及最慢完成样本。
17
+ in-flight 请求数不是排队数,路由前等待尚未测量。观测不能反推旧事故的唯一根因,
18
+ 也不构成静止证明;重启 Controller 不会刷新存活 Host。
19
+
20
+ `observations.persistence` 将主线程数据库锁等待/事务体/提交成本,与持久化
21
+ worker 的往返耗时、执行和读取成本分开。worker 摘要搭载既有响应,保留 worker
22
+ 实例标识;status 只读缓存观测,不另发诊断 RPC。比较往返和执行时间时须匹配
23
+ 同一个请求哈希,其差值还包括启动、排队、传输和主线程延迟,不是纯排队时长。
24
+ 嵌套的数据库/读取耗时已包含在 worker 执行中,不能重复相加;历史最大值可能
25
+ 来自其他请求,latest/slowest 样本保留各自时间戳。
26
+
27
+ 默认启用持久化 worker 时,周期性 Project-sync 配置检查、到期 Input 建议执行、
28
+ 运行进展及停滞诊断事务,作为完整的读/检查/写操作在 worker 内执行,调用方等待
29
+ 完成;等锁不再阻塞 socket 主线程。既有事务校验和幂等折叠保持不变。
30
+ 显式关闭 worker 或注入自定义 adapter 时仍沿用同步行为。这不是全部数据库写入的
31
+ 隔离:启动准入、邮箱领取、到期 Job 准入及其他生命周期写入仍需分别分析边界。
32
+ 这些维护操作期间状态请求可响应,不代表 Controller 的所有长停顿都已消除。
33
+
34
+ 空闲 Global 收件箱恢复检查、已处分的重试检查使用只读快照,不申请 SQLite
35
+ 写锁。真正创建恢复通知或处分未完成重试时,仍在原写事务内复核当前
36
+ Session/claim/输入。这消除的是空操作等锁,不是所有实际写入的竞争。
37
+
38
+ 生产 Controller(含升级接管后的启动)将运行诊断保存至
39
+ `runtime/controller-diagnostics.jsonl`,另保留两个轮转文件,每个最多 1 MiB,
40
+ 仅文件所有者可读写。异步写入器最多排队 32 条记录,每条最多 16 KiB,
41
+ 不写业务数据库。调度及启动错误只保留分类、指纹和构建内相对源码位置,
42
+ 不保留原始错误正文、参数或凭据。每 250 ms 仅检查内存指标;出现新的失败/
43
+ 至少 1 秒慢操作、仍在进行的慢操作或自身事件循环延迟时,每秒最多记录一次快照。
44
+ 记录包含墙钟、单调时间、PID、进程实例及版本,阶段摘要使用请求/目标哈希。
45
+ 这是采样证据,不是逐请求追踪,也不直接证明路由前阻塞原因。
46
+ `observations.diagnostics` 显示写入、丢弃、待写数量和写入失败;磁盘故障不伪装为
47
+ 记录成功。轮转、队列溢出、突然终止均可能丢失证据,主线程恢复前也无法输出快照。
48
+ 不新增自动重启或操作重放。这些可丢弃运行日志不是 Task 状态、验收依据的替代物、
49
+ 第二套恢复权威或 Home 数据格式迁移。
50
+
51
+ 调度缓存按需加载记录族,并使用事务维护的 Task 读取修订号。其他 Task 或 Global
52
+ 消息不会使未变化的本 Task 历史失效;更新、删除、其他进程写入仍正确失效。
53
+ 组合折叠固定在一个读取快照,未提交写入不产生可复用缓存标识,最多保留最近
54
+ 16 个 Task 的投影。缓存不授权派发,也不替代变更时的精确身份检查。
55
+
5
56
  ## 当前身份与持久处理回执
6
57
 
7
58
  桌面与 TUI 使用相同的当前 Session 授权。只有 `CODEX_THREAD_ID` 的桌面命令
@@ -400,6 +451,12 @@ Run 的普通 Leader 通知。未知的原生状态阻塞清理;仅停止一
400
451
  一种偏好,而不是要求证明旧对话不可恢复。该请求在 AgentRun 活动、Session 已结束或
401
452
  上一次清理待处理时都是合法的。Leader 也可以请求替换自己并结束当前轮次。
402
453
 
454
+ 对于 planning Run 已结束的 Draft Leader,替换初始化通知在确认清理后允许所选的新
455
+ Session 登记。它不会新增业务 Run、激活 Task 或接纳 delivery 工作区;后继仍只有
456
+ planning 权限,先读取当前 Task 上下文和保留的信箱原文,再处理输入。普通 Draft 通知
457
+ 和无启动范围的原生 hook 不能借用此准入。启动被拒绝时保留通知,修正原因后可显式
458
+ `task wake retry`,或再次合法替换 Session;接受状态未知的输入始终不能据此重放。
459
+
403
460
  `task role session stop` 也可以在不先更改 Run 状态的情况下停止一个运行中的 Role。它
404
461
  保留原生对话以备复用。待处理的 Message 仍是意图,可以在停止后启动一次 continuation;
405
462
  当整个 Task 都必须保持暂停时,使用 Task execution stop。对于自我替换,使用异步的
@@ -51,6 +51,73 @@ 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.18.0 compatibility and migration notes
55
+
56
+ This minor includes the already-merged independent Jobs workspace and global
57
+ Shell script Jobs (PR #490), plus Controller reliability and diagnostics.
58
+ Exact Session stop/replacement no longer waits for unrelated global scheduling
59
+ to drain. Stop proof, single-writer ownership and unknown-input replay fences
60
+ remain required. Session health distinguishes historical failures from the
61
+ current authority; conclusively rejected obsolete inputs can be retired without
62
+ erasing their original evidence.
63
+
64
+ Task-scoped lazy read caches, indexed observation queries and persistence
65
+ timings reduce projection work and separate request/worker/database costs.
66
+ With the default persistence worker, periodic maintenance lock waits no longer
67
+ block the socket thread; idle Global recovery and settled retry checks are
68
+ read-only. Actual admission and other business writes may still contend.
69
+ Bounded, redacted asynchronous diagnostics retain incident evidence in
70
+ `runtime/controller-diagnostics.jsonl` and two rotated files. These changes
71
+ address reproduced mechanisms, not a proven unique cause of every historical
72
+ timeout. See [managed runtime](managed-turn-and-session-runtime.md).
73
+
74
+ Storage advances from **1.22 through 1.23 to 1.24**: 1.23 declares revisioned
75
+ global Shell script definitions and Run snapshots; 1.24 adds Task read-revision
76
+ tokens and triggers without rewriting historical payloads. A production 1.21
77
+ Home first applies the existing 1.22 Role/Profile availability transition.
78
+ Use the centralized contiguous same-major migration, never manual schema edits.
79
+ Controller RPC and Host control/event protocols remain v1. Compatible live
80
+ Hosts/Sessions are retained, not hot-upgraded; unreported Host capabilities and
81
+ unknown results remain explicit.
82
+
83
+ With separate production authority, the Operator uses
84
+ `yui update --version 2.18.0` after verifying the published artifact. Refresh a
85
+ consistent maintenance backup and capture the current executable/Controller
86
+ identity before migration. An earlier online DB snapshot alone is not a complete
87
+ rollback point and cannot overwrite subsequently accepted input. Do not open a
88
+ 1.24 Home with an older binary; rollback requires the matching pre-upgrade
89
+ program and consistent Home backup, with intervening effects reconciled.
90
+
91
+ Release gates require exact-merge-commit Core CI and the same runtime archive's
92
+ fresh-install platform/Node matrix before npm publication. Local deterministic
93
+ tests and prior smoke evidence do not replace those gates or prove real-model
94
+ behavior. Publication does not itself update a production Home or resolve
95
+ another Task's execution.
96
+
97
+ ### 2.17.0 compatibility and migration notes
98
+
99
+ This minor adds persistent Role/Profile enable and disable controls in CLI and
100
+ Web settings. Use `yui config role enable|disable`, `yui config profile
101
+ enable|disable`, and `yui task role enable|disable` with the relevant identity.
102
+ Disabled templates cannot be selected for new bindings; existing Task Role
103
+ copies remain independent. Disabling a Role prevents new execution and pauses
104
+ eligible pending work; it does not kill a running Turn, discard pending input,
105
+ block exact terminal recording or erase inspection/claim/acknowledgement access.
106
+ Re-enabling resumes eligible work under its existing authority and retry budgets,
107
+ without replaying accepted or unknown input.
108
+
109
+ Storage advances from **1.21 to 1.22** through the centralized additive migration
110
+ for optional `enabled` fields. Existing records without the field remain enabled;
111
+ their historical payloads are preserved. With separate upgrade authorization,
112
+ use `yui update --version 2.17.0`; the updater owns preflight, backup, migration
113
+ and Controller handover. Do not open the upgraded Home with an older binary.
114
+
115
+ The release also includes the merged Draft planning Session replacement repair
116
+ and stronger behavioral-constraint/real-path review handoffs. Validation uses
117
+ deterministic tests and the exact-tarball fresh-install matrix, not real-model
118
+ behavior. Publishing does not update the global CLI, migrate a production Home,
119
+ restart its Controller or deploy a production Web listener.
120
+
54
121
  ### 2.16.0 compatibility and migration notes
55
122
 
56
123
  This minor refreshes the Web workbench (PR #484). One global navigation rail
@@ -36,6 +36,54 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
36
36
  不能将不兼容冒称为兼容,也不为回避版本选择新增历史兼容机制。包版本与协议、
37
37
  持久存储契约仍然独立:兼容性检查和必要迁移要求不变,下文存储规则不授予发版权限。
38
38
 
39
+ ### 2.18.0 兼容性及迁移说明
40
+
41
+ 本 minor 包含已合入的独立 Jobs 工作区和全局 Shell 脚本 Job(PR #490),以及
42
+ Controller 可靠性与诊断改进。精确 Session 停止/替换不再等待无关全局调度排空;
43
+ 停止证明、单写者和未知输入防重放仍受保护。Session 健康区分历史故障与当前权限,
44
+ 明确拒绝的过期输入可以合法退役,原始证据保留。
45
+
46
+ Task 局部惰性缓存、索引查询和持久化耗时观测减少投影开销,并区分请求、worker
47
+ 和数据库成本。默认持久化 worker 承担周期维护事务的锁等待;空闲 Global 恢复和
48
+ 已处分重试检查只读。实际启动准入和其他业务写入仍可能竞争。异步脱敏诊断保存到
49
+ `runtime/controller-diagnostics.jsonl` 及两个有界轮转文件。这些改进解决已复现机制,
50
+ 不代表已证明每次历史超时的唯一根因。参见[托管运行时](managed-turn-and-session-runtime.zh-CN.md)。
51
+
52
+ 存储从 **1.22 经 1.23 升至 1.24**:1.23 声明全局 Shell 脚本定义及精确 Run 快照;
53
+ 1.24 增加 Task 读取修订号与触发器,不改写历史载荷。生产 1.21 Home 会先执行已有的
54
+ 1.22 Role/Profile 启停字段迁移。必须使用集中式同 major 连续迁移,不手工修改数据库。
55
+ Controller RPC、Host control/event 协议仍为 v1;兼容的存活 Host 和 Session 保留,
56
+ 而非热更新。Host 未报告能力及未知结果仍明确保留。
57
+
58
+ 另行获得生产授权后,由 Operator 核验实际发布包,再执行
59
+ `yui update --version 2.18.0`。迁移前刷新一致的维护备份,记录当时程序与 Controller
60
+ 身份。较早的在线数据库快照不是完整回滚点,不可覆盖后续已接受输入。
61
+ 旧二进制不能打开 1.24 Home;回滚需要匹配的旧程序和升级前一致 Home 备份,
62
+ 并核对期间发生的效果。
63
+
64
+ 发布门禁要求精确 merge commit 的 Core CI,以及同一运行包的全新安装平台/Node
65
+ 矩阵通过后才能发布 npm。本地确定性测试与既有 smoke 不替代这些门禁,也不证明
66
+ 真实模型行为。发布本身不更新生产 Home,不代表其他 Task 执行问题已解决。
67
+
68
+ ### 2.17.0 兼容性及迁移说明
69
+
70
+ 本 minor 在 CLI 和 Web 设置中新增持久化的 Role/Profile 启用、停用控制。
71
+ 可使用 `yui config role enable|disable`、`yui config profile enable|disable`
72
+ 及 `yui task role enable|disable`,并指定对应身份。停用的模板不可用于新绑定;
73
+ 已复制到 Task 的 Role 保持独立。停用 Role 会阻止新的执行并暂停符合条件的待执行工作,
74
+ 但不杀死正在运行的 Turn、不丢弃待处理输入、不阻止精确终态补录,也不移除查看、
75
+ claim 和 ACK 权限。重新启用后,符合条件的工作按原有权限和重试预算继续,
76
+ 不会重放已接受或结果未知的输入。
77
+
78
+ 存储通过集中式增量迁移从 **1.21 升至 1.22**,加入可选的 `enabled` 字段。
79
+ 没有该字段的已有记录仍视为启用,历史载荷保持不变。另行获得升级授权后,可使用
80
+ `yui update --version 2.17.0`;updater 负责预检、备份、迁移与 Controller 交接。
81
+ 不得使用旧二进制打开升级后的 Home。
82
+
83
+ 本次发布还包含已合入的 Draft 规划 Session 替换修复,以及强化行为约束和真实调用路径的
84
+ 审查交接说明。验证依据为确定性测试与精确 tarball 的全新安装矩阵,不代表真实模型行为验证。
85
+ 发布本身不会更新全局 CLI、迁移生产 Home、重启其 Controller 或部署生产 Web listener。
86
+
39
87
  ### 2.16.0 兼容性及迁移说明
40
88
 
41
89
  本 minor 更新 Web 工作台(PR #484):工作台与管理页共用一条全局导航栏
@@ -18,7 +18,51 @@ 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
- ## Profiles
21
+ ## Enable and disable
22
+
23
+ Availability is configuration, separate from active Agent selection, Session
24
+ activity and the Task execution gate:
25
+
26
+ ```sh
27
+ yui config role disable worker
28
+ yui config role enable worker
29
+ yui config profile disable implementer
30
+ yui config profile enable implementer
31
+ yui task role disable task-1 reviewer
32
+ yui task role enable task-1 reviewer
33
+ ```
34
+
35
+ `update --enabled true|false` uses the same rules. Repeating an enable/disable
36
+ is a no-op. Settings → Role/Profile exposes the same boolean with its scope.
37
+ List/show keeps disabled entries visible; application selectors exclude them.
38
+
39
+ A disabled Global Role cannot start/resume execution, receive a new automatic
40
+ Turn, or create a new Task binding from that template. This includes Operator,
41
+ Leader, Worker and Job-owned Roles. An existing Task Role instead uses its own
42
+ flag, even when its original template is disabled. A disabled Profile cannot be
43
+ applied; inherited runtime also requires an enabled Global Worker. Explicit
44
+ Agent Profiles also require an enabled Worker when copying a matching Worker
45
+ binding's options; an explicit Agent without such a binding uses its own defaults.
46
+ No fallback Agent, account or reviewer is chosen.
47
+
48
+ Disabling never kills a Session, cancels a Run, settles a claim, acknowledges
49
+ input or discards unknown delivery evidence. Current execution can finish and
50
+ report. New delivery and automatic recovery wait; retry budgets are not reset
51
+ or extended. Use the existing stop/interrupt operations when stopping is intended.
52
+ Enabling does not start an empty Session, activate a Draft, reopen a completed
53
+ Task, override a Task stop, or replay accepted/unknown effects. Normal scheduling
54
+ continues only where existing lifecycle, authority and exact-input fences allow.
55
+
56
+ All settings remain editable while disabled. Profile reset restores builtin
57
+ content but preserves enabled state; initialization and upgrades do not revive
58
+ disabled entries. Deletion retains its existing reference checks. Missing
59
+ `enabled` in older records means enabled; storage 1.21 → 1.22 adds this optional
60
+ field without rewriting old records or frozen Session/context evidence.
61
+ If Operator or a Task Leader is disabled, use the authorized local CLI/Web
62
+ configuration entry to re-enable it; a disabled critical responsibility is not
63
+ silently replaced or considered completed.
64
+
65
+ ## Profile behavior
22
66
 
23
67
  An Agent Profile combines portable behavior—instructions, Skills and access
24
68
  intent—with runtime intent. Runtime either follows the current Global Worker
@@ -15,6 +15,41 @@ Task Role 是 Task 局部的;global Role 提供已配置的默认值和全局
15
15
  的 global Role。只有当请求的 Task Role 不存在时,global Role 才作为创建模板。
16
16
  可用性、producer 分离和冻结的审查候选仍然适用。
17
17
 
18
+ ## 启用与停用
19
+
20
+ 启停是配置状态,与 Active Agent、Session 是否运行和 Task executionGate 分开:
21
+
22
+ ```sh
23
+ yui config role disable worker
24
+ yui config role enable worker
25
+ yui config profile disable implementer
26
+ yui config profile enable implementer
27
+ yui task role disable task-1 reviewer
28
+ yui task role enable task-1 reviewer
29
+ ```
30
+
31
+ `update --enabled true|false` 使用相同规则;重复启停不产生变化。
32
+ Web 设置页的 Role/Profile 提供同一开关和作用域提示。
33
+ list/show 保留停用项供查看和恢复,应用选择器不提供不可用项。
34
+
35
+ Global Role 停用阻止它自身的新启动、恢复、自动 Turn,以及从该模板新建 Task
36
+ 绑定;Operator、Leader、Worker 和 Job-owned Role 同样适用。已复制的 Task Role
37
+ 以自身开关为准,不随模板停用。Profile 停用后不能新应用;动态继承还要求 Global
38
+ Worker 可用。显式 Agent Profile 若复制匹配 Worker 绑定的配置选项,也要求
39
+ Worker 启用;没有匹配绑定的显式 Agent 使用其默认配置。不偷偷切换 Agent、账号或审查角色。
40
+
41
+ 停用不强停 Session、不取消 Run、不消费 claim/ACK,也不丢弃未知投递证据。
42
+ 运行中的执行可以正常收尾和报告;新投递及自动恢复等待,原重试预算不重置或延长。
43
+ 需要停止时使用既有 stop/interrupt。启用不是立即启动空 Session,不激活 Draft、
44
+ 重开已完成 Task、解除 Task 停止或重放已接受/未知效果;仅允许原调度在原生命周期、
45
+ 权限及准确输入约束内继续。
46
+
47
+ 停用期间仍可编辑配置。Profile reset 恢复内置内容但保留启停状态;初始化、升级
48
+ 不会复活停用项。删除沿用已有引用检查。旧记录缺少 `enabled` 默认启用,
49
+ 存储 1.21 → 1.22 只声明新增可选字段,不改写历史记录、冻结 Session 或上下文。
50
+ 若 Operator/Task Leader 被停用,可由有权限的本地 CLI/Web 配置入口恢复;
51
+ 系统不会跳过关键职责、换人或假定完成。
52
+
18
53
  ## Profile
19
54
 
20
55
  Agent Profile 把可移植行为(指令、Skill 和访问意图)与运行时意图组合在一起。
@@ -2,7 +2,25 @@
2
2
 
3
3
  # Storage baseline 1.0
4
4
 
5
- Current storage is 1.21. The 1.20 → 1.21 transition converts provably unedited
5
+ Current storage is 1.24. The 1.23 → 1.24 transition adds transaction-maintained
6
+ Task read-cache revisions for the scheduler's nine source tables. Inserts,
7
+ updates and deletions invalidate only the affected Task; rollback also rolls
8
+ back the token. These tokens are derived cache identities, never Task authority
9
+ or a replacement for the Home revision CAS. Historical payloads are unchanged,
10
+ and existing Tasks start with an implicit zero token until their first mutation.
11
+ Two partial indexes support exact runtime-observation identity lookup without
12
+ scanning or deserializing the historical observation set.
13
+
14
+ The 1.22 → 1.23 transition adds global Shell Job
15
+ definitions with revisioned script files and per-Run executable snapshots.
16
+ It preserves existing payloads without rewriting any Job, schedule or history.
17
+
18
+ The 1.21 → 1.22 transition admits an optional boolean
19
+ `enabled` on Roles and Profiles. Absence means enabled. SQL layout, historical
20
+ payloads, existing Task bindings, Session snapshots and input receipts are
21
+ unchanged; upgrade does not launch or stop execution.
22
+
23
+ The 1.20 → 1.21 transition converts provably unedited
6
24
  built-in Project sync defaults to timezone-explicit clock schedules, archiving
7
25
  their original bytes under migration 21. Ambiguous higher revisions and custom
8
26
  plans remain unchanged; no Git work or reauthorization occurs. See
@@ -2,7 +2,16 @@
2
2
 
3
3
  # 存储基线 1.0
4
4
 
5
- 当前存储为 1.21。1.20 → 1.21 将可证明未经修改的旧内置 Project 同步默认计划
5
+ 当前存储为 1.24。1.23 → 1.24 为调度器的九类来源表增加事务维护的 Task 读取缓存修订号。插入、更新和删除只使对应 Task 的缓存失效,回滚同时回滚修订号。该值仅是派生缓存标识,不是 Task 权限或 Home revision CAS 的替代。历史 payload 不变,旧 Task 在首次修改前使用隐含的零修订号。
6
+ 同时增加两个局部索引,支持按精确运行观测身份查找,不再扫描或反序列化历史观测集合。
7
+
8
+ 1.22 → 1.23 新增全局 Shell Job、版本化脚本文件及每次运行的配置快照,不改写已有 Job、计划和历史记录。
9
+
10
+ 1.21 → 1.22 为 Role/Profile 声明可选布尔字段 `enabled`,
11
+ 缺省表示启用。SQL 布局、历史 payload、已有 Task 绑定、Session 快照和输入回执
12
+ 保持不变;升级不启动或停止执行。
13
+
14
+ 1.20 → 1.21 将可证明未经修改的旧内置 Project 同步默认计划
6
15
  转换为显式时区的整点计划,在 migration 21 下归档原始字节。更高 revision 的
7
16
  来源不明确计划及自定义计划保留,不执行 Git 或重新授权。保守转换边界见
8
17
  [Project 同步](project-sync.zh-CN.md)。
@@ -14,7 +14,9 @@ may benefit from a short Task artifact index:
14
14
 
15
15
  - Goal/non-goals and effective decision references.
16
16
  - Observable scenarios, expected behavior and independent contract sources.
17
- - Contract entry points, callers and key risks.
17
+ - For cross-layer/async risks, a short actual path: entry, consumers, relevant
18
+ waits/atomic commits, result and failure/recovery consequences, linked to
19
+ candidate code or existing documentation.
18
20
  - Candidate identity and actual check results (commit, environment, command,
19
21
  result), distinguishing unexecuted scenarios and uncovered boundaries.
20
22
  - For full re-review: repair delta, previous findings' dispositions and still
@@ -29,6 +31,38 @@ Later Brief/decision edits do not change an existing Review snapshot. This is
29
31
  not a document-completeness gate, prose parser or Skill-version freeze.
30
32
  Ordinary full review and the existing equivalence Delta Recheck remain distinct.
31
33
 
34
+ ### Keep the material small and actionable
35
+
36
+ These are examples, not mandatory sections or a scenario quota. A simple E01
37
+ handoff can cite its half-open interval contract and `main.mjs/select` directly:
38
+ the caller supplies bounds and receives rows; timezone conversion is a non-goal.
39
+ No separate path document is needed.
40
+
41
+ For E03, the contract requires unchanged opaque cursors and ordered items.
42
+ The actual path is caller -> `main.mjs/collect` -> await
43
+ `page.mjs/fetchPage(cursor)` -> consume items/cursor -> next request or return.
44
+ There is no persistent commit. Check the cursor at the downstream consumer,
45
+ not merely the first successful page; a rejected request rejects collection,
46
+ so accumulated rows are not returned as success. Retry/concurrent mutation is
47
+ outside this example's contract. The index is a navigation hint, not a finding
48
+ or a claim that all paths were inspected.
49
+
50
+ Keep evidence roles separate: that contract is the expectation;
51
+ `scripts/review-eval/verify.mjs`'s E03 probes are executable references;
52
+ only an actual `node scripts/review-eval/evaluate.mjs verify` invocation plus its
53
+ candidate commit, environment and output establishes a result. The probes use
54
+ the two supplied modules for the counterexample, a one-page normal control,
55
+ and a controlled wait followed by rejection to check pending/failure behavior.
56
+ They do not exercise a live server, crash recovery or Reviewer behavior.
57
+
58
+ In a pause/resume task, constraints might instead distinguish unsubmitted
59
+ intent, registered/unknown effects, terminal settlement and legal resumption.
60
+ Those are domain-specific examples, not universal state-machine requirements.
61
+ Use the task's own contract and reachable paths. After a shared-root finding,
62
+ check the other affected consumers in the same scope and refresh the small
63
+ index and repair evidence; do not append the entire review history. Reviewer
64
+ inspection still covers the complete frozen candidate, not just these hints.
65
+
32
66
  ## Small development corpus
33
67
 
34
68
  `scripts/review-eval/` is an offline file tool, not a scheduler, model adapter or
@@ -12,7 +12,8 @@
12
12
 
13
13
  - 目标/非目标及有效决定入口。
14
14
  - 可观察场景、预期行为和独立契约依据。
15
- - 契约入口、调用方及关键风险。
15
+ - 对跨层/异步风险,提供简短实际链路:入口、消费者、关键等待/原子提交边界、
16
+ 结果及失败/恢复后果,并指向候选代码或已有文档。
16
17
  - 候选身份和实际检查结果(提交、环境、命令、结果),区分未执行场景与未覆盖边界。
17
18
  - 完整复审追加修复 delta、历史 Findings 处置及仍适用证据;当前完整冻结候选仍在范围内。
18
19
 
@@ -23,6 +24,29 @@
23
24
  后续 Brief/决定修改不改变既有 Review Snapshot。这不是文档齐全门禁、
24
25
  自然语言解析器或 Skill 版本冻结机制。普通完整复审与已有等价性 Delta Recheck 保持不同语义。
25
26
 
27
+ ### 保持材料简短且可用
28
+
29
+ 以下是示例,不是必填章节或场景配额。简单的 E01 交接可直接引用半开区间契约和
30
+ `main.mjs/select`:调用方提供边界并接收行,时区转换是非目标,无须另写链路文档。
31
+
32
+ E03 的契约要求原样传递不透明游标并按顺序返回条目。实际链路是:
33
+ 调用方 -> `main.mjs/collect` -> 等待 `page.mjs/fetchPage(cursor)` ->
34
+ 消费条目/游标 -> 下一次请求或返回。这里没有持久化提交。
35
+ 应检查下游消费者收到的游标,而不只是首个成功页面;请求拒绝时收集操作拒绝,
36
+ 已累计条目不会作为成功结果返回。重试/并发修改不属于此例契约。
37
+ 索引只是定位提示,不是缺陷结论,也不声称已检查所有路径。
38
+
39
+ 分清证据身份:上述契约是预期;`scripts/review-eval/verify.mjs` 的 E03
40
+ 探针是可执行引用;只有实际运行 `node scripts/review-eval/evaluate.mjs verify`
41
+ 并保留候选提交、环境和输出才构成结果。探针用给定的两个模块验证反例,
42
+ 提供单页正常对照,以及可控等待后拒绝的未完成/失败行为检查;
43
+ 不覆盖真实服务、崩溃恢复或 Reviewer 行为。
44
+
45
+ 暂停/恢复类任务的约束可能分别要求:未提交意图保留、已登记/未知效果不重放、
46
+ 已有执行允许终态收尾、恢复后沿合法意图继续。这些是领域示例,不是通用状态机要求。
47
+ 应以本任务契约和可达路径为依据。同根因发现后检查同范围内其他受影响消费者,
48
+ 刷新简短索引与修复证据,不追加整轮历史;Reviewer 仍检查完整冻结候选,不局限于这些提示。
49
+
26
50
  ## 小型开发集
27
51
 
28
52
  `scripts/review-eval/` 是离线文件工具,不是调度器、模型适配器或新增 Core 存储。
@@ -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.21 and its declared 1.0 through 1.20 minor
56
+ The stable suite owns current storage 1.24 and its declared 1.0 through 1.23 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.21, exact schema/record validation, no initialization over
61
+ 1. Fresh storage 1.24, 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,12 +39,12 @@ 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.21 和明确声明的 1.0 至 1.20 连续小版本迁移,
42
+ 稳定套件维护当前存储 1.24 和明确声明的 1.0 至 1.23 连续小版本迁移,
43
43
  不包含未声明的历史格式兼容路径。
44
44
 
45
45
  当前覆盖包括:
46
46
 
47
- 1. 新建存储 1.21、精确结构与记录校验、禁止覆盖未知数据库、无修改拒绝旧整数格式。
47
+ 1. 新建存储 1.24、精确结构与记录校验、禁止覆盖未知数据库、无修改拒绝旧整数格式。
48
48
  2. 精确版本暂存、目标不匹配拒绝、同主版本连续小版本预检、交接锁显式所有者,
49
49
  以及恢复时核对捕获的协议和存储身份,不接受缺失字段。
50
50
  3. 持久 Task/Message/Decision 上下文、Draft 激活权威、mailbox 认领、
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "2.16.0",
3
+ "version": "2.18.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,
@@ -1 +1 @@
1
- 6
1
+ 7
@@ -303,12 +303,20 @@ authority. Never invent authorization, impersonate Operator, or modify the core
303
303
 
304
304
  ## Validate and make the review judgment
305
305
 
306
- Prepare useful evidence, not a documentation gate. Supply or reference the
307
- effective goals/non-goals and decisions, independently grounded expected
308
- behavior, key user paths/constraints, contract entry points and relevant callers.
309
- Keep three things distinct: a behavioral scenario and its expectation, an
310
- executable test reference, and an actual result with candidate/environment/
311
- command. Disclose real gaps rather than deriving acceptance from current code.
306
+ Prepare useful evidence, not a documentation gate. From effective requirements,
307
+ non-goals and decisions, distill the few observable behavioral constraints that
308
+ matter to this change, with independently grounded expectations. Do not infer
309
+ correctness from the candidate or its mocks.
310
+
311
+ For material cross-layer or asynchronous risks, trace a short real path in the
312
+ exact candidate: entry -> actual consumers -> relevant waits/atomic commit
313
+ boundaries -> observable result and failure/recovery consequences. Point to
314
+ candidate code or existing documents, not just module names or a coverage claim.
315
+ Use it to expose where the same constraint must hold across boundaries; do not
316
+ enumerate every entry or generate a combination matrix. Keep three things
317
+ distinct: constraints/scenarios and expectations, executable test references,
318
+ and actual results with candidate/environment/command. Name material unverified
319
+ boundaries; a test reference alone is not a passing result.
312
320
 
313
321
  Small tasks can reference existing materials directly. For complex tasks, put a
314
322
  short review index in Task artifacts and its commit-pinned reference in Brief.
@@ -380,8 +388,11 @@ main synthesis through its exact AgentRun, preserving its selected source snapsh
380
388
  A Worker or Reviewer AgentRun result is evidence, not acceptance. Inspect the
381
389
  result, diff, checks, and current Candidate before deciding.
382
390
 
383
- Group confirmed findings by root cause and repair other reachable instances
384
- within scope together. For ordinary full re-review, preserve the current complete
391
+ Group confirmed findings by root cause. Use the traced paths to check other
392
+ reachable consumers/boundaries within scope and repair affected instances
393
+ together, not just the reported checkpoint. Refresh the short material index
394
+ and repair evidence where they changed, without accumulating round-by-round
395
+ history. For ordinary full re-review, preserve the current complete
385
396
  candidate and requirements; add repair delta, prior finding dispositions and
386
397
  still-valid evidence. Delta is an attention aid, not the full-review boundary.
387
398
  Do not conflate this with an explicitly authorized equivalence Delta Recheck.