@zq-silk/yui 2.8.1 → 2.10.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 (119) hide show
  1. package/README.md +5 -3
  2. package/dist/cli/commandCatalog.js +56 -21
  3. package/dist/cli/helpRenderer.js +3 -1
  4. package/dist/cli/interactionPolicy.js +2 -2
  5. package/dist/commands/durableJobCommands.js +50 -0
  6. package/dist/commands/globalRoleCommands.js +30 -9
  7. package/dist/commands/inboxCommands.js +79 -22
  8. package/dist/commands/projectCommands.js +4 -33
  9. package/dist/commands/scheduleCommands.js +45 -0
  10. package/dist/commands/taskActivationCommands.js +19 -5
  11. package/dist/commands/taskCommands.js +8 -2
  12. package/dist/commands/taskFactCommands.js +24 -12
  13. package/dist/commands/taskProjectDeliveryCommand.js +56 -0
  14. package/dist/commands/taskPublicationCommands.js +6 -3
  15. package/dist/commands/taskPublicationVerifyCommand.js +74 -28
  16. package/dist/commands/taskRemoteDeliveryCommand.js +5 -3
  17. package/dist/context/runContextPack.js +25 -4
  18. package/dist/context/runInputContract.js +1 -0
  19. package/dist/context/taskContext.js +53 -16
  20. package/dist/context/taskPhase.js +99 -0
  21. package/dist/controlPlaneCli.js +38 -17
  22. package/dist/controller/controller.js +35 -0
  23. package/dist/controller/fileSchedulerStoreAdapter.js +75 -16
  24. package/dist/controller/globalInputDelivery.js +17 -7
  25. package/dist/controller/inboxTurnCheck.js +64 -0
  26. package/dist/controller/jobControl.js +42 -12
  27. package/dist/controller/jobDefinitionControl.js +304 -0
  28. package/dist/controller/jobSupervisor.js +47 -32
  29. package/dist/controller/providerRetryAdmission.js +2 -0
  30. package/dist/controller/runtime.js +11 -2
  31. package/dist/controller/scheduleControl.js +176 -0
  32. package/dist/coordination/workMailbox.js +3 -3
  33. package/dist/external/githubPublicationVerifier.js +14 -5
  34. package/dist/external/gitlabPublicationVerifier.js +12 -29
  35. package/dist/grant/taskAuthorization.js +7 -2
  36. package/dist/interaction/notificationPresentation.js +12 -3
  37. package/dist/interaction/operatorPresentation.js +5 -0
  38. package/dist/job/builtinJob.js +58 -0
  39. package/dist/job/durableJob.js +72 -49
  40. package/dist/job/jobDefinition.js +68 -0
  41. package/dist/job/jobRunner.js +2 -1
  42. package/dist/job/projectRefreshRunner.js +48 -0
  43. package/dist/message/globalInboxRecovery.js +44 -0
  44. package/dist/message/globalInterrupt.js +1 -1
  45. package/dist/message/inboxReceipt.js +14 -6
  46. package/dist/message/inboxTurn.js +86 -0
  47. package/dist/message/message.js +11 -0
  48. package/dist/message/taskInboxOwnership.js +20 -6
  49. package/dist/repository/projectRefresh.js +58 -0
  50. package/dist/repository/taskWorkspacePreparer.js +2 -1
  51. package/dist/repository/workspaceCleanupInspection.js +6 -1
  52. package/dist/schedule/schedule.js +108 -0
  53. package/dist/scheduler/operatorEvent.js +2 -0
  54. package/dist/scheduler/operatorInputNotificationProcessor.js +8 -0
  55. package/dist/storage/contextRecords.js +8 -0
  56. package/dist/storage/jobSchema.js +15 -0
  57. package/dist/storage/maintenanceCaller.js +1 -1
  58. package/dist/storage/recordValidation.js +5 -0
  59. package/dist/storage/scheduleSchema.js +12 -0
  60. package/dist/storage/sqliteSchema.js +95 -24
  61. package/dist/storage/sqliteStore.js +123 -10
  62. package/dist/storage/storageVersions.js +1 -1
  63. package/dist/storage/storeRpc.js +5 -0
  64. package/dist/storage/upgrade/jobDefinitionMigration.js +22 -0
  65. package/dist/task/archiveDiagnostics.js +1 -1
  66. package/dist/task/archivePreflight.js +1 -1
  67. package/dist/task/projectDeliveryScope.js +20 -0
  68. package/dist/task/publicationToolObservation.js +126 -0
  69. package/dist/task/remoteDelivery.js +19 -8
  70. package/dist/task/remoteDeliveryService.js +5 -4
  71. package/dist/task/taskActivationService.js +35 -0
  72. package/dist/web/assets/client/app/settings.js +7 -1
  73. package/dist/web/assets/client/i18n/en.js +65 -2
  74. package/dist/web/assets/client/i18n/zh-CN.js +65 -2
  75. package/dist/web/assets/client/index.js +2 -0
  76. package/dist/web/assets/client/views/jobs.js +222 -0
  77. package/dist/web/assets/client/views/task/deliveryResults.js +6 -2
  78. package/dist/web/assets/client/views/task/page.js +11 -1
  79. package/dist/web/assets/shared/manageNav.js +1 -0
  80. package/dist/web/assets/shared/taskTabs.js +2 -2
  81. package/dist/web/assets/shell/settingsContent.js +3 -0
  82. package/dist/web/assets/styles/index.js +2 -0
  83. package/dist/web/assets/styles/views/jobs.js +19 -0
  84. package/dist/web/controllerWeb.js +73 -21
  85. package/dist/web/taskPreviews.js +21 -13
  86. package/dist/web/webAccess.js +109 -0
  87. package/dist/web/webJobs.js +52 -0
  88. package/dist/web/webServer.js +76 -44
  89. package/docs/architecture/capabilities-and-resources.md +6 -4
  90. package/docs/architecture/capabilities-and-resources.zh-CN.md +5 -4
  91. package/docs/cli-information-contract.md +57 -4
  92. package/docs/cli-information-contract.zh-CN.md +41 -2
  93. package/docs/job-runs.md +224 -0
  94. package/docs/project-delivery-scope.md +59 -0
  95. package/docs/release-workflow.md +86 -0
  96. package/docs/release-workflow.zh-CN.md +68 -0
  97. package/docs/schedules.md +132 -0
  98. package/docs/storage-baseline.md +31 -1
  99. package/docs/storage-baseline.zh-CN.md +25 -1
  100. package/docs/task-delivery.md +74 -2
  101. package/docs/task-delivery.zh-CN.md +39 -1
  102. package/docs/testing/verification-levels.md +6 -2
  103. package/docs/testing/verification-levels.zh-CN.md +6 -3
  104. package/i18n/README.zh-CN.md +6 -3
  105. package/package.json +4 -3
  106. package/skills/yui-leader/SKILL.md +44 -1
  107. package/skills/yui-leader/VERSION +1 -1
  108. package/skills/yui-leader/references/planning.md +9 -1
  109. package/skills/yui-operator/SKILL.md +31 -0
  110. package/skills/yui-operator/VERSION +1 -1
  111. package/skills/yui-reviewer/SKILL.md +4 -0
  112. package/skills/yui-reviewer/VERSION +1 -1
  113. package/skills/yui-runtime/SKILL.md +67 -8
  114. package/skills/yui-runtime/VERSION +1 -1
  115. package/skills/yui-runtime/references/context-ordering.md +103 -0
  116. package/skills/yui-runtime/references/publication.md +44 -4
  117. package/skills/yui-runtime/references/recovery.md +21 -0
  118. package/skills/yui-worker/SKILL.md +5 -0
  119. package/skills/yui-worker/VERSION +1 -1
@@ -0,0 +1,132 @@
1
+ # Persistent time plans
2
+
3
+ A Schedule answers **when** to admit a Run of an existing scoped Job. It owns
4
+ the time rule and trigger progress, not the command, execution status or result.
5
+ Immediate execution remains `job run`; manual Runs do not move a Schedule.
6
+ All processing uses the existing Controller and the Job supervisor.
7
+
8
+ ## Public CLI and API
9
+
10
+ ```sh
11
+ yui schedule create --global --schedule daily-probe --job probe \
12
+ --rule '{"kind":"cron","expression":"30 9 * * 1-5","timezone":"Asia/Shanghai"}'
13
+ yui schedule list --global
14
+ yui schedule show --global --schedule daily-probe
15
+ yui schedule disable --global --schedule daily-probe --revision 1
16
+ yui schedule enable --global --schedule daily-probe --revision 2
17
+ yui schedule update --global --schedule daily-probe --revision 3 \
18
+ --rule '{"kind":"interval","anchor":"2026-10-17T00:00:00Z","everyMs":3600000}'
19
+ ```
20
+
21
+ Create the referenced Job first using [the Job CLI](job-runs.md). Replace
22
+ `--global` with `--task task-N` for a Task-owned Schedule. Global management
23
+ requires a current authenticated Operator Session; Task callers cannot access
24
+ global or other Tasks' plans. Assignment limits are checked against the Job
25
+ on the server. A Project is a Job target, never an ownership scope.
26
+
27
+ The Controller RPC is `schedule.control`. Its input is
28
+ `{op,scope,caller,id?,jobId?,rule?,expectedRevision?}`. Supported `op` values
29
+ are `create`, `list`, `show`, `update`, `enable`, `disable`. `scope` uses the
30
+ Job `JobScope` contract. Trusted ingress must resolve/authenticate `caller`;
31
+ client-supplied scope/identity is not authorization. `create` requires `id`,
32
+ `jobId`, `rule`; all edits require the observed `expectedRevision`. `update`
33
+ requires a complete rule and optionally changes `jobId` within the same scope,
34
+ revalidating both old visibility and new execution authority. Scope is immutable.
35
+ Rule updates retain enabled status only for an already enabled plan; all other
36
+ states become disabled with the new future rule and require explicit enable.
37
+
38
+ Create/edits return the Schedule; list returns visible Schedule records.
39
+ Show returns `{schedule,lastSuccess}`. `lastSuccess` is the latest readable
40
+ **succeeded JobRun** triggered by this Schedule under its current Job, or null.
41
+ It is derived from Run history, never a separately writable Schedule field.
42
+ Retargeting does not move or erase the old Job's Run history.
43
+
44
+ ## Time and trigger rules
45
+
46
+ - Once: `{"kind":"once","at":"2026-10-17T08:00:00+08:00"}`. Creation and rule
47
+ replacement require a future instant with an explicit UTC offset.
48
+ - Interval: `{"kind":"interval","anchor":"2026-10-17T00:00:00Z","everyMs":60000}`.
49
+ Minimum interval is 1000 ms. Occurrences are anchor + N × everyMs, N ≥ 0.
50
+ The next occurrence is strictly after creation/edit/enable time. Manual
51
+ execution and maintenance delays never shift the anchor.
52
+ - Cron: five fields, explicit IANA timezone, `cron-parser` 5.10.2 semantics.
53
+ Random `H` is rejected. DST spring gaps move the nonexistent time forward
54
+ by the offset change; repeated fall local times select the earlier instance
55
+ once. For example New York 02:30 on March 8, 2026 becomes 03:30 (07:30Z);
56
+ 01:30 on November 1 selects 05:30Z, with the next daily occurrence November 2
57
+ at 06:30Z. This deliberately uses the parser's policy, not a custom
58
+ “skip gap / both folds” enumerator.
59
+
60
+ `nextDue` is persisted as UTC. Each Controller reconciliation admits at most
61
+ one occurrence per selected Schedule, with at most 100 due Schedules per pass.
62
+ Plans are ordered by oldest attempt to prevent blocked once plans starving
63
+ others. This is maintenance-resolution scheduling, not a real-time timer:
64
+ actual admission can lag the due instant by Controller load/reconciliation
65
+ interval. No independent daemon or per-plan timer is created.
66
+
67
+ After downtime, the earliest pending occurrence represents the coalesced
68
+ work; the next occurrence is strictly after the current clock/high-water fence.
69
+ There is no historical catch-up queue. A persisted UTC `processedThrough`
70
+ prevents clock rollback or rule edits from replaying old progress.
71
+ Rule updates increase `generation`; enable retains it. The internal trigger
72
+ key is `<schedule-id>:<generation>:<UTC-due>`, scoped to the Job.
73
+
74
+ Admission and advancement commit in the same Store transaction. Repeated scans
75
+ and Controller replacement retain the same Run and occurrence identity.
76
+ The transaction never spawns. The supervisor starts committed Runs and
77
+ preserves its existing unknown-effect and exact-process safeguards.
78
+ This is not an exactly-once guarantee for external side effects.
79
+
80
+ ## State and authority
81
+
82
+ `enabled` allows future admission; `disabled` is explicit user/Agent disposal
83
+ of future intent; `completed` means a once occurrence was **admitted**, not that
84
+ its Run succeeded; `needs-attention` preserves blocked intent; `retired` records
85
+ Task terminal shutdown. Disabling does not cancel an already admitted Run,
86
+ and cancelling a Run does not disable its Schedule.
87
+
88
+ `lastAttempt` records `at`, `dueAt`, `outcome` (`admitted`, `overlap`, `blocked`),
89
+ optional exact `runId`, and reason. An overlap Run is the occupying execution,
90
+ not a successful execution of this occurrence. Recurring overlap skips that
91
+ coalesced tick and advances; once overlap retains its original due instant and
92
+ retries admission on a later pass without adding a queued Run.
93
+ Failed Runs stay in Job history; the next recurring tick follows the same plan.
94
+
95
+ Creation, update and enable capture the authenticated Session binding and Job
96
+ revision. They do not grant execution to a replacement Session or a changed
97
+ Job definition. Before each admission both are checked again, along with current
98
+ Job/Task/workspace prerequisites. Revocation or a changed definition stops the
99
+ plan as `needs-attention`; an authorized current manager must inspect and
100
+ explicitly enable it. Controller restart alone does not revoke the binding.
101
+ Worker-owned plans also retain the current Assignment boundary.
102
+
103
+ Unclassified admission failures roll back, stop that plan, persist the reason
104
+ and notify its Task Leader or global Operator via existing durable inboxes.
105
+ No new recovery queue, lease or automatic retry protocol is introduced.
106
+
107
+ Task stop marks enabled plans as needing attention; restarting execution alone
108
+ does not silently reactivate them. Normal Task completion refuses unfulfilled
109
+ enabled/blocked once plans: explicitly disable or fulfil them first. Repeating
110
+ plans do not block completion and are atomically retired with the Task.
111
+ Cancellation/archive retires enabled/blocked plans with their reason and
112
+ history preserved. Existing active/unknown Runs retain all earlier lifecycle
113
+ settlement guards. A reopened Task does not implicitly resume retired plans.
114
+
115
+ ## Storage and downstream integration
116
+
117
+ Storage **1.9 → 1.10** appends `schedules`, keyed by `(scope_key,schedule_id)`,
118
+ and its due index. Old Job/Run bytes and published baseline checksums remain
119
+ unchanged. New Homes initialize 1.10; existing Homes require the centralized
120
+ explicit upgrade path. No real Home migration or package release is implied.
121
+
122
+ `src/schedule/schedule.ts` exports `Schedule`, `ScheduleRule`, time calculation
123
+ and validation. `src/controller/scheduleControl.ts` owns management and bounded
124
+ reconciliation; `admitJobRun` remains the only execution admission seam.
125
+ Consumers should use RPC/service responses rather than write storage directly.
126
+
127
+ Project refresh is a separate controlled Job action supplied by Task128.
128
+ Schedule does not implement refresh or Knowledge maintenance. A refresh Job
129
+ can use the same reference-only plan once that action is integrated and tested;
130
+ this document alone is not evidence of that joint integration.
131
+ InputRequest recommended-option deadlines, heartbeat, redelivery and other
132
+ internal domain timers remain with their existing owners.
@@ -2,7 +2,37 @@
2
2
 
3
3
  # Storage baseline 1.0
4
4
 
5
- Current storage is 1.8. The declared 1.7 → 1.8 transition permits an optional
5
+ Current storage is 1.13. The 1.12 → 1.13 transition permits exact native attempt
6
+ identity on new inbox claims, exact target identity on new steer controls,
7
+ explicit Global inbox retirement and terminal handling-check evidence.
8
+ It does not rewrite historical messages, infer old turn ownership or synthesize
9
+ ACKs. SQL layout is unchanged. Current inputs and historical missing handling
10
+ evidence have separate bounded discovery views; neither is a second queue.
11
+
12
+ The 1.11 → 1.12 transition admits append-only
13
+ `task.project-delivery-decided` events with Project requirement, reason, actor,
14
+ original Message/digest/quote and the previous decision ID. Existing records and
15
+ SQL layout are unchanged. No historical exclusions are inferred; absent decisions
16
+ retain the required-delivery default. See [Project delivery scope](project-delivery-scope.md).
17
+
18
+ The declared 1.10 → 1.11 transition adds source provenance
19
+ to new activation-request event payloads: an existing Message/body digest or
20
+ exact caller-attributed native input, plus the recorded Message boundary.
21
+ Historical events are preserved without guessed sources or replay. Missing
22
+ provenance is an explicit read diagnostic. SQL layout and frozen digests are
23
+ unchanged; the centralized transition has no data rewrite.
24
+ New Task Job status/result/cancellation/acknowledgement writes also append
25
+ `job.state-changed` events atomically. Existing Job history is not backfilled.
26
+
27
+ The 1.9 → 1.10 transition appends independent
28
+ [Schedules](schedules.md) and their due index without rewriting Jobs or Runs.
29
+
30
+ The declared 1.8 → 1.9 transition adds stable Job
31
+ definitions and global Runs, and links each historical Task execution to its
32
+ own definition while preserving exact IDs, artifacts and Integration references.
33
+ Original Job payload bytes are archived. See [Job/Run contracts](job-runs.md).
34
+
35
+ The declared 1.7 → 1.8 transition permits an optional
6
36
  Model management connection in Yui configuration. Only service addresses and
7
37
  file references are stored; no credentials are imported. Existing Homes remain
8
38
  unconfigured, and the SQL layout is unchanged.
@@ -2,7 +2,31 @@
2
2
 
3
3
  # 存储基线 1.0
4
4
 
5
- 当前存储为 1.8。1.7 → 1.8 允许在 Yui 配置中保存可选的 Model 管理连接,
5
+ 当前存储为 1.13。1.12 → 1.13 允许新 inbox claim 记录精确 native attempt、
6
+ 新 steer control 记录精确目标,以及 Global 输入显式退役和终态缺回执检查证据。
7
+ 不改写历史消息、不推断旧轮次归属、不补造 ACK;SQL 布局不变。
8
+ 当前输入和历史处理缺证据通过有界视图分别发现,不新增第二队列。
9
+
10
+ 1.11 → 1.12 允许追加 `task.project-delivery-decided` 事件,
11
+ 记录 Project 交付要求、原因、actor、原始 Message/digest/引用及前一决定 ID。
12
+ SQL 布局和历史记录不变,不自动推断历史排除;没有决定时仍按需交付处理。
13
+ 详见 [Project 交付范围](project-delivery-scope.md)。
14
+
15
+ 1.10 → 1.11 为新 activation-request 事件增加来源证据:
16
+ 已有 Message 及正文 digest,或带调用者归属的原生输入原文,以及当时的 Message 序号边界。
17
+ 历史事件保持原样,不推测缺失来源、不重放输入;缺失来源通过读取诊断明确展示。
18
+ SQL 布局及冻结 digest 不变,集中迁移不改写历史正文。
19
+ 新的 Task Job 状态、结果、取消请求及确认处置原子追加 `job.state-changed` 事件;
20
+ 不回填历史 Job 事件。
21
+
22
+ 1.9 → 1.10 追加独立 [Schedule](schedules.md) 表和到期索引,
23
+ 不改写历史 Job/Run,也不自动启用任何计划。
24
+
25
+ 1.8 → 1.9 新增稳定 Job 定义和 global Run;每条历史 Task 执行
26
+ 独立映射为定义,保留原执行 ID、产物与 Integration 精确引用,并归档原始 payload。
27
+ 详见 [Job/Run 契约](job-runs.md)。
28
+
29
+ 1.7 → 1.8 允许在 Yui 配置中保存可选的 Model 管理连接,
6
30
  仅保存服务地址及文件引用,不导入凭据;已有 Home 保持未配置,SQL 布局不变。
7
31
 
8
32
  1.6 → 1.7 为规范 Message 和 Leader wake 增加可选的 Agent
@@ -208,8 +208,10 @@ Task Integration produced that exact candidate, pass its local ID with
208
208
  This records one Task event, not a new delivery status, Candidate lifecycle,
209
209
  Git operation, or permission to change completed work.
210
210
 
211
- `task publication verify` remains the explicit, authorized provider read. It
212
- records the remote source head, PR/MR state and merge commit independently of
211
+ `task publication verify` accepts tool-neutral evidence with `--observation
212
+ <json>`, or performs an explicit authorized provider read with the optional
213
+ gh/glab adapter when that option is absent. Neither tool is mandatory.
214
+ It records the remote source head, PR/MR state and merge commit independently of
213
215
  Task acceptance. A mismatched head or non-merged state is saved as **reported**,
214
216
  superseding earlier verification; provider errors or mismatched external identity
215
217
  write nothing. A merged provider observation verifies only that Publication's
@@ -218,6 +220,76 @@ Metadata/verification successors preserve adoption only through an uninterrupted
218
220
  same-candidate Publication lineage. Candidate or referenced Integration changes
219
221
  cannot silently reuse the decision.
220
222
 
223
+ ### Record a Leader's tool observation
224
+
225
+ First `publication upsert` the owning Task's exact candidate, PR/MR URL and
226
+ target branch. The Leader can inspect that object with any authorized CLI/API,
227
+ interpret its result, and submit the following JSON using
228
+ `task publication verify task-1/publication-1 --observation '<json>'`:
229
+
230
+ ```json
231
+ {
232
+ "taskId": "task-1",
233
+ "publicationId": "publication-1",
234
+ "projectId": "project-1",
235
+ "provider": "gitlab",
236
+ "repository": "team/app",
237
+ "externalKind": "merge-request",
238
+ "externalId": "42",
239
+ "externalUrl": "https://forge.example/team/app/-/merge_requests/42",
240
+ "targetBranch": "main",
241
+ "localCommit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
242
+ "state": "merged",
243
+ "headCommit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
244
+ "remoteCommit": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
245
+ "observedAt": "2026-10-17T04:00:00.000Z",
246
+ "tool": "internal-cli",
247
+ "command": "internal-cli mr inspect team/app!42",
248
+ "output": "{\"iid\":42,\"state\":\"merged\",\"sha\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"merge_commit_sha\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"}"
249
+ }
250
+ ```
251
+
252
+ Replace every example identity, SHA, timestamp and output with observed facts.
253
+ `provider` describes the forge (GitHub PR or GitLab MR), not the tool brand.
254
+ All fields shown are required for a merged observation; `remoteCommit` is optional
255
+ for open/closed, and `mergedAt` is optional. Output must be a nonempty, sanitized
256
+ relevant response excerpt, not credentials or just a conclusion; the whole JSON
257
+ is limited to 64 KiB. Yui never executes `command` or parses arbitrary output into
258
+ success. It trusts the authorized caller's inspection and checks exact identity,
259
+ URL/service, target, candidate and timestamps.
260
+
261
+ New evidence must refer to the current Publication, be no more than 24 hours
262
+ old and not future-dated. Observation may precede initial bookkeeping or a
263
+ title-only update. Immutable history supplies the lower time bound only when
264
+ the candidate, object, target or remote facts materially changed; changing and
265
+ restoring a candidate does not revive earlier evidence. After a title-only
266
+ update, bind the same actual result to the current record ID without re-querying.
267
+ An exact immediate retry returns the existing receipt without duplicating it;
268
+ later changes cannot replay it. The full canonical JSON is kept in the existing
269
+ opaque `evidence` text, with actor and record time on the immutable Publication.
270
+ There is no new persistent format or migration; historical records remain valid.
271
+ Once recorded, verification is a fixed observation, not live monitoring or a
272
+ 24-hour archive lease. Known later changes require a successor; failures and
273
+ unknown results never assert a fresh success. URL/target/candidate changes reset
274
+ verification, while title-only changes can retain it.
275
+ GitHub repository URL comparison respects case-insensitive owner/name identity.
276
+ GitLab browser routes are deployment-specific: standard `/-/merge_requests/`,
277
+ legacy `/merge_requests/`, and custom service paths are allowed in both entry
278
+ points. Identity comes from structured repository/MR evidence, not a URL path
279
+ template. The complete registered URL must still match after URL parsing and
280
+ removal of one trailing slash; HTTP(S) is required and credentials, query and
281
+ fragment remain forbidden. The provider URL is retained, not rewritten to a
282
+ guessed route. A successful HTTP response is not merge evidence.
283
+ Adapter observations retain the observed target
284
+ branch even when the earlier Publication did not specify one; missing targets
285
+ cannot establish new verification.
286
+
287
+ `upsert --verified` is now rejected: use this observation path or the optional
288
+ adapter. No natural-language summary or bare flag verifies a merge. Existing
289
+ verified records are not rewritten. Remote delivery and ordinary archive reuse
290
+ sufficient exact evidence without another gh/glab read; acceptance, business
291
+ settlement, stopped execution and safe resource cleanup remain independent.
292
+
221
293
  CLI, current Leader Context and Web derive coverage from these same facts, with
222
294
  no provider reads or evidence writes. They distinguish not delivered, merged
223
295
  but uncovered, covering merge not verified, partial delivery and verified merge.
@@ -161,13 +161,51 @@ Review 时跳过刷新,该新鲜度字段为 null。重复完成不重新观
161
161
  `--integration <id>`,一并绑定其已提交证据。这只新增一个 Task 事件,不新增交付
162
162
  状态表、Candidate 生命周期或 Git 操作,也不授权修改已完成成果。
163
163
 
164
- `task publication verify` 仍是显式且须获授权的 provider 读取。它独立于 Task
164
+ `task publication verify --observation '<json>'` 接受 Leader 通过任意获授权
165
+ CLI/API 得到的精确工具证据;省略此选项时才使用可选 gh/glab 适配器执行 provider
166
+ 读取。不强制工具品牌,也不要求已充分核验的结果再用 gh/glab 重查。它独立于 Task
165
167
  验收,记录远端 source head、PR/MR 状态和 merge commit。head 不匹配或尚未合并时,
166
168
  保存为 **reported** 并取代旧验证;provider 错误或外部身份不匹配则不写任何证据。
167
169
  已合并的 provider 观察仅验证该 Publication 的精确本地候选;squash 不需要伪造
168
170
  提交祖先关系。元数据/验证更新只有沿连续同候选的 Publication 血缘才能继承采用;
169
171
  候选或所引用的 Integration 变化,不能悄悄复用旧决定。
170
172
 
173
+ 先用 `publication upsert` 登记本 Task 的精确候选、PR/MR URL(含服务地址)和
174
+ 目标分支,再用工具检查该对象。观察 JSON 的完整示例见
175
+ [工具证据录入](task-delivery.md#record-a-leaders-tool-observation);
176
+ 必需字段为 `taskId`、`publicationId`、`projectId`、`provider`、`repository`、
177
+ `externalKind`、`externalId`、`externalUrl`、`targetBranch`、`localCommit`、
178
+ `state`、`headCommit`、`observedAt`、`tool`、`command`、`output`。
179
+ 合并状态还必须有 `remoteCommit`,`mergedAt` 可选。SHA 为完整小写值,时间为
180
+ ISO 时间戳。`provider` 表示 GitHub/GitLab 服务,不表示工具品牌。
181
+ `output` 保留经过脱敏的实际响应关键摘录,不是凭据或一句“已合并”结论;
182
+ 完整 JSON 最大 64 KiB。Yui 不执行 `command`,不解析任意自然语言来判定成功。
183
+ Leader 负责实际检查和解释输出,Core 负责身份、服务 URL、目标、候选和时间绑定。
184
+
185
+ GitLab 浏览路径由服务部署决定:两个验证入口均允许标准 `/-/merge_requests/`、
186
+ legacy `/merge_requests/` 和自定义服务路径,不再用 URL 模板推断仓库/MR 身份。
187
+ 结构化身份仍须匹配;完整登记 URL 经 URL 解析及移除一个末尾斜杠后仍须一致。
188
+ 仅允许 HTTP(S),禁止凭据、query 和 fragment;保留 provider 返回的 URL,
189
+ 不改写为猜测的路由。HTTP 访问成功不是合并证据。
190
+
191
+ 新证据必须引用当前不可变 Publication,距登记不超过 24 小时且不能在未来。
192
+ 观察可以早于首次登记或仅标题更新;只有不可变历史中的候选、对象、目标或远程事实
193
+ 发生实质变化,才构成观察时间下界。候选改变后又恢复,也不能复用变化前的证据。
194
+ 仅标题更新时,将实际结果绑定到当前记录 ID,无需重新查询。
195
+ 相同观察的直接重试复用原回执;之后发生变化
196
+ 不能重放旧回执。完整规范化 JSON 保存在既有不透明 `evidence` 文本中,操作者和
197
+ 登记时间由 Publication 保留;没有新增持久化格式,也不改写历史证据。
198
+ 登记后的验证是固定观察,不是实时监控或 24 小时归档租约;已知后续变化须另记
199
+ 后继事实。失败或未知结果不能变成新的验证成功。URL、目标分支、候选变化会失效
200
+ 旧验证;仅标题变化可保留验证。
201
+ GitHub URL 按 owner/name 不区分大小写比较;GitLab 支持相对部署路径,但完整的
202
+ 已登记服务前缀仍须匹配。适配器会持久化实际读到的目标分支,即使原记录未填写;
203
+ 缺失目标分支不能建立新的验证。
204
+
205
+ `upsert --verified` 现在会被拒绝,请使用上述观察入口或可选适配器。
206
+ 现存已验证历史保持可读。普通归档复用精确充分的证据,不重跑指定工具;
207
+ 候选验收、业务结清、执行停止和安全清理检查不变。
208
+
171
209
  CLI、当前 Leader Context 和 Web 从同一组事实推导覆盖,不联网、不写证据。展示
172
210
  区分尚未交付、PR/MR 已合并但未覆盖、已覆盖合并但未验证、部分交付、已验证合并。
173
211
  每个 Project 保留自己的验收 head、候选、采用引用和原因。缺失的历史 head 仍然
@@ -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.8 and its declared 1.0/1.1/1.2/1.3/1.4/1.5/1.6/1.7 minor
53
+ The stable suite owns current storage 1.13 and its declared 1.0 through 1.12 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.8, exact schema/record validation, no initialization over
58
+ 1. Fresh storage 1.13, 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
@@ -75,6 +75,10 @@ Current coverage includes:
75
75
  8. Failure isolation for optional Controller maintenance, individual retry
76
76
  Sessions and Task continuation observation, with scoped errors and no
77
77
  fabricated delivery, cancellation or quiescence.
78
+ 9. Activation-source handoff without replay, Brief guards across same-timestamp
79
+ input, Home/baseline-bound fixed event windows, and complete frozen-ref deltas
80
+ with removals. These deterministic checks establish contracts, not a model's
81
+ semantic conflict judgment.
78
82
 
79
83
  Keep the test phase seconds-scale and measure build separately. Use the
80
84
  existing assembled-package smoke for actual CLI/Controller/Host/tmux wiring,
@@ -36,12 +36,12 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
36
36
  ## 永久 core smoke
37
37
 
38
38
  `npm test` 和 `npm run test:core` 构建当前 checkout 并运行维护中的套件。
39
- 稳定套件只维护当前存储 1.0 和未来明确声明的小版本迁移,不包含任何历史
40
- 转换实现、样本或兼容测试。
39
+ 稳定套件维护当前存储 1.13 和明确声明的 1.0 至 1.12 连续小版本迁移,
40
+ 不包含未声明的历史格式兼容路径。
41
41
 
42
42
  当前覆盖包括:
43
43
 
44
- 1. 新建存储 1.0、精确结构与记录校验、禁止覆盖未知数据库、无修改拒绝旧整数格式。
44
+ 1. 新建存储 1.13、精确结构与记录校验、禁止覆盖未知数据库、无修改拒绝旧整数格式。
45
45
  2. 精确版本暂存、目标不匹配拒绝、同主版本连续小版本预检、交接锁显式所有者,
46
46
  以及恢复时核对捕获的协议和存储身份,不接受缺失字段。
47
47
  3. 持久 Task/Message/Decision 上下文、Draft 激活权威、mailbox 认领、
@@ -54,6 +54,9 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
54
54
  和备份行为。
55
55
  8. Controller 可选维护、各个重试 Session、Task continuation 观察的失败隔离,
56
56
  诊断包含所属对象,不伪造投递、取消或静默状态。
57
+ 9. 无重放的激活来源交接、同时间戳新输入使 Brief 写入校验失效、绑定 Home 与基线的
58
+ 固定事件窗口,以及含移除项的完整冻结引用增量。这些确定性测试验证契约,
59
+ 不代表已验证真实模型的语义冲突判断效果。
57
60
 
58
61
  测试阶段保持秒级,构建单独计时。真实 CLI/Controller/Host/tmux 接线复用现有
59
62
  组装包冒烟,不新增守护进程矩阵;稳定套件不重建任何已退役的存储路径。
@@ -27,7 +27,7 @@ Yui 是面向编程 Agent 的本地控制面。你只需用自然语言把目标
27
27
  - **自带 Agent** —— Codex CLI、Claude Code CLI 和 ACP 通过统一边界接入,
28
28
  可替换而不丢失 Task。
29
29
  - **本地优先、私有** —— 一切运行在你自己的机器上,面向单个受信任用户;
30
- Web 仅本地回环,包含只读视图和经认证的用户控制。
30
+ Web 默认本地回环,可显式开启带认证的可信内网访问。
31
31
  - **默认隔离** —— 仓库改动发生在受管 Git worktree 中,稳定 checkout 保持只读。
32
32
 
33
33
  > **状态:** 1.1.0,当前存储版本为 1.1,已声明从 1.0 基线升级。默认更新只执行同一存储
@@ -156,6 +156,9 @@ Agent 可以重新读取任务上下文,继续兼容的 Session,或在必要
156
156
  想直观看进展,可以在另一个终端运行 `yui web`。本地 Web 展示同一份任务与
157
157
  待回答问题,也允许发送消息、回答问题,以及显式 queue、steer 或 interrupt Task 输入。
158
158
  这些经认证的 Task 控制复用 CLI 的相同操作,不是另一套需要同步的任务系统。
159
+ 内网监听要求权限受限的凭证文件;浏览器使用原生认证提示(用户名 `yui`)。
160
+ 当前 Operator 可按用户请求启动、查询和停止,不能冒充浏览器用户。HTTP 不加密。
161
+ 详见[受控 Web 访问](../docs/web-access.md)的命令、地址发现、凭证轮换及安全边界。
159
162
  详情分为四个页签:概览(用户待办、任务进展和关键决定)、交付(工作项、评审、
160
163
  集成与远程交付,按需读取)、运行(Role、原生会话活动、进行中的执行和用量)、
161
164
  记录(决定、里程碑、执行与问题的时间线)。详见[用户关注与进展](../docs/observability/README.zh-CN.md#web-用户关注与进展)。
@@ -263,7 +266,7 @@ Yui 为你组织的东西 —— 是持久对象,而不是进程:
263
266
  它负责搬运工作、记录事实——但从不判断回答好坏
264
267
 
265
268
  Agent 在 Project 中工作:只读 checkout + 隔离 worktree。
266
- Web(yui web):本地回环视图 + 经认证的用户控制。
269
+ Web(yui web):默认本地回环 + 显式认证的内网访问。
267
270
  ```
268
271
 
269
272
  ### 分层设计
@@ -272,7 +275,7 @@ Yui 为你组织的东西 —— 是持久对象,而不是进程:
272
275
 
273
276
  ```text
274
277
  体验层 Experience — 你如何交互
275
- CLI(Operator)· Web(本地回环、经认证)· 原生 Agent 会话
278
+ CLI(Operator)· Web(本地 / 经认证内网)· 原生 Agent 会话
276
279
  采集输入 · 展示事实 · 确认操作 · 调用能力
277
280
  ▼
278
281
  决策层 Intelligence — 谁来决定
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "2.8.1",
3
+ "version": "2.10.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,
@@ -48,12 +48,13 @@
48
48
  "dependencies": {
49
49
  "@xterm/addon-fit": "^0.11.0",
50
50
  "@xterm/xterm": "^6.0.0",
51
+ "cron-parser": "5.10.2",
51
52
  "node-pty": "1.2.0-beta.15",
52
53
  "smol-toml": "1.8.0",
53
54
  "ws": "^8.21.1"
54
55
  },
55
56
  "optionalDependencies": {
56
- "sqlite-modern": "npm:better-sqlite3@13.0.3",
57
- "sqlite-compat": "npm:better-sqlite3@10.1.0"
57
+ "sqlite-compat": "npm:better-sqlite3@10.1.0",
58
+ "sqlite-modern": "npm:better-sqlite3@13.0.3"
58
59
  }
59
60
  }
@@ -42,6 +42,11 @@ transcript or process.
42
42
 
43
43
  Apply terminal/gate and read-only intent boundaries before selecting delivery
44
44
  or planning work; the routes below do not override those restrictions.
45
+ When old discussion text differs from new intent, apply
46
+ [current intent and temporal reads](../yui-runtime/references/context-ordering.md):
47
+ inspect exact sources before treating normal stage progression as a conflict.
48
+ An adopted same-scope development request supersedes the earlier discussion-only
49
+ stage, not independent restrictions. Never use active status or Brief alone.
45
50
 
46
51
  - **Draft or planning-only authority:** read [Planning and activation handoff](references/planning.md).
47
52
  Use the recorded submission intent (`record`, `discuss`, `develop`) and
@@ -100,7 +105,8 @@ then ack the exact entry. Inbox acknowledgement
100
105
  never accepts a Candidate or completes the Task.
101
106
 
102
107
  The DB Brief is the current summary, not a full plan or a history of messages.
103
- After meaningful progress, use `task brief update` with only intended fields;
108
+ After meaningful progress, read `task brief show` and use
109
+ `task brief update --if-current <writeGuard>` with only intended fields;
104
110
  read `task event list` before deliberately restoring an older value. Keep
105
111
  references to substantial plans, prototypes and reports in that summary.
106
112
  When a delivered correction resolves a recorded blocker or changes the next
@@ -111,6 +117,10 @@ before `task complete`. The completion summary is the terminal conclusion;
111
117
  do not copy it into Brief merely to create a second completion record. Brief
112
118
  maintenance is not a new completion gate, and routine unchanged steps do not
113
119
  need an update.
120
+ Also reconcile the summary at requirement changes and phase handoffs; carry the
121
+ exact activation/input references. Core projects current lifecycle and source
122
+ diagnostics without rewriting historical messages. A stale-guard rejection
123
+ requires reading the new input and reconciling, not retrying the old text.
114
124
  Decisions contain the actual decision, reason and necessary boundaries, not
115
125
  the entire proposal. Label recommendations as recommendations, not user
116
126
  decisions.
@@ -132,6 +142,39 @@ heartbeat or unchanged wait. Ordinary fact edits need no self-wake.
132
142
 
133
143
  ## Close the current turn
134
144
 
145
+ ### Adjust Project delivery scope without erasing work
146
+
147
+ When explicit user intent or an original delegation allows a Project to leave
148
+ the final delivery, read that original Message and `task remote-delivery`.
149
+ Record the bounded decision with
150
+ `task project delivery <task> <project-id> --requirement excluded --reason <reason>
151
+ --source-message <message-id> --purpose <verbatim-authorization>
152
+ --if-current <scopeDecision.id|none>`.
153
+ Interpret whether the original really authorizes this scope change; a matching
154
+ quote alone is not semantic permission. Do not exclude a Project to conceal an
155
+ unmet commitment. Ask only for a genuinely missing scope decision, not a second
156
+ approval when existing user intent or delegated judgment already covers it.
157
+ Use the same operation with `--requirement required` and the latest decision ID
158
+ to restore normal checks. Reconcile a stale guard instead of overwriting newer
159
+ intent. These append-only decisions also work on completed, unarchived Tasks
160
+ without reopening, rewriting acceptance, or rerunning work.
161
+
162
+ Unchanged Projects need no exclusion. Required changed/unknown Projects still
163
+ need exact verified delivery. Excluded Projects retain their binding, code
164
+ changes and Publication facts and are not counted as merged or verified merely
165
+ because they are excluded. Scope is not execution, write, archive or deletion
166
+ authority: open commitments and unknown execution still need settlement, and
167
+ unique commits or dirty resources remain protected. With separate archive
168
+ authorization, use ordinary archive/preflight and report retained resources;
169
+ do not recommend force merely because an authorized Project is excluded.
170
+
171
+ For external delivery, choose any available authorized CLI/API and follow
172
+ [Publication evidence](../yui-runtime/references/publication.md). Record exact
173
+ tool observations through `publication verify --observation`; gh/glab are optional
174
+ adapters, not mandatory trusted brands. Do not repeat a sufficient exact
175
+ verification merely to use a different tool. Tool inspection is your judgment;
176
+ candidate acceptance, immutable evidence and ordinary archive safety still apply.
177
+
135
178
  - **Planning:** save meaningful revisions, summarize the discussion and await
136
179
  feedback. This is a complete turn; it needs no WorkItem, Review, InputRequest
137
180
  or Task completion just to stop.
@@ -1 +1 @@
1
- 3
1
+ 6
@@ -56,7 +56,15 @@ and historical Runs/Sessions count even when no Session is currently busy.
56
56
  CLI commands: an authorized Operator can perform the mechanical operation.
57
57
 
58
58
  With that authorization, inspect any existing activation request before creating
59
- one with `task activation request <task-id> --request-id <id> --environment <plan>`.
59
+ one with `task activation request <task-id> --request-id <id> --environment <plan>
60
+ --source-message <message-id>`. If the new authorization arrived directly in
61
+ the native conversation and has no saved Message, use `--source-text` with the
62
+ exact user input instead. Core records this as caller-attributed source text in
63
+ the immutable activation event, not a new Message or another delivery. Never
64
+ substitute a Brief paraphrase, fabricate user authorship, or resend the input.
65
+ Keep the same source and request ID on retries. Read the returned source event
66
+ when diagnosing a mismatch. Update Brief with the new intent and source refs
67
+ before ending the planning turn; do not rewrite old user messages.
60
68
  Choose the plan from the authorized resources; retain the request id for retries.
61
69
  The Controller adopts an eligible request. `task activate <task-id>` is the
62
70
  foreground adoption operation for an existing request, not a request-free shortcut.
@@ -183,6 +183,23 @@ user-owned configuration and external-effect boundaries.
183
183
  Escalate only a real product tradeoff, new authority, unavailable external fact,
184
184
  credential, irreversible effect, or safety boundary.
185
185
 
186
+ For user-requested Web lifecycle operations, use `yui web`, `yui web --status`
187
+ and `yui web --stop` with the current Operator identity and intended Home.
188
+ Operator starts return a Controller-owned receipt without holding this turn
189
+ open. Non-loopback binding requires `--auth-file <absolute-path>` containing
190
+ an owner-only (0600) regular file with a unique 32–128 character printable ASCII
191
+ password; browser username is `yui`. There is no default password.
192
+ Honor the user's exact network exposure and credential scope. Never clear
193
+ managed identity, impersonate a browser user, launch a bypass server or restart
194
+ the Controller merely to open Web. Report actual access URLs and failures,
195
+ never a wildcard address or an old snapshot as a working link. Explain that
196
+ HTTP is unencrypted, and keep credentials out of messages, logs and URLs.
197
+ Lifecycle authority does not authenticate visitors. On unknown startup outcome,
198
+ inspect status before retrying; a running listener is not proof of remote reachability.
199
+ Stopping Web closes browser connections without stopping Agents. Password
200
+ rotation requires explicit stop/start; changing the file alone does not revoke
201
+ the running credential. Controller recovery does not automatically reopen Web.
202
+
186
203
  ## Configure Yui through confirmed conversation
187
204
 
188
205
  Read both effective configuration and the catalog before explaining or changing
@@ -237,6 +254,10 @@ Apply **yui-runtime**'s own-inbox flow at useful routing boundaries and before
237
254
  handoff. `yui inbox list/show/claim/ack` processes Operator input in this turn;
238
255
  do not wait for another wake or copy pending notices into new input. Read every
239
256
  relevant original and finish the authorized routing/disposition before ack.
257
+ Routing to an owning Task, recording a necessary user question, or verifying
258
+ that a later request superseded a notice may settle this input immediately;
259
+ cite the durable reference and do not wait for the downstream Task to finish.
260
+ Use the Runtime current/history split and never replay effects to repair ACK.
240
261
 
241
262
  Use JSON reads and their top-level `data` field.
242
263
  Use Global Context's bounded `pending` page to find Messages, then
@@ -287,6 +308,16 @@ Distinguish settled business and stopped execution from safely retained
287
308
  physical resources. Ordinary archive may retain the latter; follow the shared
288
309
  archive diagnostics and exact cleanup actions instead of requesting force
289
310
  merely for old terminal Integration worktrees or preserved diagnostics.
311
+ When only some bound Projects remain in the final delivery, preserve the exact
312
+ user scope decision or delegation in the owning Task and route it to its Leader.
313
+ The Leader can record `task project delivery` with the original Message and
314
+ latest scope-decision guard; this also works for completed, unarchived Tasks
315
+ without reopening them. An unchanged Project already needs no delivery.
316
+ An explicitly excluded Project is not a verified merge and its data is not
317
+ disposable. Use the shared remote-delivery/preflight projection, settle open
318
+ business and execution independently, and use ordinary authorized archive
319
+ while reporting safely retained resources. Do not demand force, delete bindings,
320
+ or solicit repeated Operator approval when the original scope authority suffices.
290
321
  When the user explicitly authorizes force archive for an eligible terminal
291
322
  Task, archive even if delivery proof or cleanup is incomplete. Report the
292
323
  warnings and retained resources without claiming merge verification or physical
@@ -1 +1 @@
1
- 3
1
+ 6
@@ -57,6 +57,10 @@ own-inbox flow for current-ReviewRound clarification. Read complete originals,
57
57
  claim before handling, and ack after disposition. These messages supplement
58
58
  the frozen pack; they cannot replace its Candidate, expand review scope, or
59
59
  turn acknowledgement into a review verdict.
60
+ Use Runtime's [temporal read contract](../yui-runtime/references/context-ordering.md)
61
+ for stale summaries or delayed input. Current facts can explain a handoff but
62
+ cannot silently replace the frozen candidate. Read original source relations
63
+ before reporting a historical planning-stage restriction as a current conflict.
60
64
 
61
65
  Verify the exact AgentRun identity, Context Pack, frozen head, and ReviewRound-owned
62
66
  workspace before inspecting candidate sources. If context loading or workspace
@@ -1 +1 @@
1
- 3
1
+ 4