@zq-silk/yui 0.16.2 → 1.0.0-alpha

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 (111) hide show
  1. package/README.md +6 -4
  2. package/dist/agent/agent.js +4 -9
  3. package/dist/agent/executionComponents.js +4 -4
  4. package/dist/agentRun/agentRun.js +8 -8
  5. package/dist/artifacts/managedGit.js +3 -56
  6. package/dist/brief/taskBrief.js +3 -3
  7. package/dist/cli/updateOrchestrator.js +2 -13
  8. package/dist/cli/updatePorts.js +36 -69
  9. package/dist/cli/upgradeCommand.js +4 -8
  10. package/dist/cli.js +4 -7
  11. package/dist/commands/controllerCommands.js +1 -1
  12. package/dist/commands/taskCommands.js +8 -1
  13. package/dist/commands/taskRoleRuntimeStatus.js +1 -1
  14. package/dist/context/runInputContract.js +1 -1
  15. package/dist/controller/agentRuntimeObserver.js +4 -4
  16. package/dist/controller/clientRuntime.js +19 -44
  17. package/dist/controller/controller.js +16 -4
  18. package/dist/controller/fileSchedulerStoreAdapter.js +6 -6
  19. package/dist/controller/globalInputDelivery.js +3 -1
  20. package/dist/controller/jobSupervisor.js +3 -3
  21. package/dist/controller/providerRetryDelivery.js +128 -118
  22. package/dist/controller/runtime.js +1 -1
  23. package/dist/controller/structuredProviderObservation.js +1 -1
  24. package/dist/coordination/workMailbox.js +4 -4
  25. package/dist/core/controllerIdentity.js +25 -0
  26. package/dist/core/controllerProcessIdentity.js +2 -2
  27. package/dist/core/controllerServer.js +4 -2
  28. package/dist/core/protocol.js +1 -1
  29. package/dist/domain/validation.js +6 -0
  30. package/dist/event/taskEvent.js +3 -3
  31. package/dist/execution/workItemExecution.js +2 -2
  32. package/dist/executor/agentExecutor.js +6 -6
  33. package/dist/executor/effectiveLaunch.js +3 -3
  34. package/dist/grant/capabilityGrant.js +2 -2
  35. package/dist/input/inputRequest.js +4 -4
  36. package/dist/integration/changeSet.js +3 -3
  37. package/dist/integration/integrationAttempt.js +3 -3
  38. package/dist/integration/integrationSourceApplication.js +1 -1
  39. package/dist/job/durableJob.js +1 -1
  40. package/dist/job/jobRunner.js +2 -2
  41. package/dist/message/message.js +8 -6
  42. package/dist/milestone/milestone.js +3 -3
  43. package/dist/profile/agentProfile.js +3 -3
  44. package/dist/release/runtimeRelease.js +9 -7
  45. package/dist/repository/project.js +3 -3
  46. package/dist/resources/liveReferences.js +1 -1
  47. package/dist/resources/sqliteResourceRegistry.js +2 -2
  48. package/dist/review/reviewRound.js +5 -5
  49. package/dist/role/role.js +7 -8
  50. package/dist/runtime/acpProtocol.js +2 -3
  51. package/dist/runtime/agentDriverObservation.js +1 -1
  52. package/dist/runtime/agentHost.js +3 -3
  53. package/dist/runtime/agentHostProtocol.js +2 -2
  54. package/dist/runtime/codexInteractiveHost.js +1 -1
  55. package/dist/runtime/launchBroker.js +1 -1
  56. package/dist/runtime/processExitObservation.js +1 -1
  57. package/dist/runtime/providerContinuationReconciliationService.js +84 -75
  58. package/dist/runtime/providerRuntimeIdentity.js +3 -3
  59. package/dist/runtime/runtimeCoherence.js +7 -3
  60. package/dist/runtime/runtimeObservation.js +3 -3
  61. package/dist/runtime/sessionOwnerIdentity.js +1 -1
  62. package/dist/runtime/taskRuntimeIsolation.js +3 -3
  63. package/dist/runtime/tmuxAdapters.js +3 -3
  64. package/dist/scheduler/taskWake.js +1 -1
  65. package/dist/storage/baselineSchema.js +606 -0
  66. package/dist/storage/homeLayout.js +5 -16
  67. package/dist/storage/recordValidation.js +16 -4
  68. package/dist/storage/sqliteSchema.js +106 -1741
  69. package/dist/storage/sqliteStore.js +16 -14
  70. package/dist/storage/storageSchema.js +8 -7
  71. package/dist/storage/storageVersions.js +23 -16
  72. package/dist/storage/taskStore.js +3 -29
  73. package/dist/storage/upgrade/upgradeOrchestrator.js +14 -102
  74. package/dist/task/task.js +15 -7
  75. package/dist/task/taskActivation.js +5 -4
  76. package/dist/telemetry/sqliteTelemetryStore.js +2 -2
  77. package/dist/verification/gateArtifact.js +5 -3
  78. package/dist/verification/verificationPlan.js +6 -7
  79. package/dist/workItem/workItem.js +6 -6
  80. package/dist/workspace/cleanupInspection.js +1 -9
  81. package/dist/worktree/managedWorkspace.js +3 -3
  82. package/docs/managed-turn-and-session-runtime.md +26 -14
  83. package/docs/managed-turn-and-session-runtime.zh-CN.md +18 -10
  84. package/docs/release-workflow.md +52 -300
  85. package/docs/release-workflow.zh-CN.md +41 -234
  86. package/docs/sqlite-control-plane-design.md +48 -289
  87. package/docs/sqlite-control-plane-design.zh-CN.md +37 -53
  88. package/docs/storage-baseline.md +132 -0
  89. package/docs/storage-baseline.zh-CN.md +106 -0
  90. package/docs/task-delivery.md +3 -4
  91. package/docs/task-delivery.zh-CN.md +3 -3
  92. package/docs/testing/verification-levels.md +40 -180
  93. package/docs/testing/verification-levels.zh-CN.md +27 -131
  94. package/i18n/README.zh-CN.md +5 -4
  95. package/package.json +1 -1
  96. package/dist/storage/migrations/agentFailureContext.js +0 -22
  97. package/dist/storage/migrations/agentRunContract.js +0 -159
  98. package/dist/storage/migrations/artifactsToGit.js +0 -338
  99. package/dist/storage/migrations/collapseWorktreeLayout.js +0 -963
  100. package/dist/storage/migrations/currentInputContract.js +0 -86
  101. package/dist/storage/migrations/currentRuntimeContract.js +0 -228
  102. package/dist/storage/migrations/historicalVerificationPlan.js +0 -35
  103. package/dist/storage/migrations/integrationContinuation.js +0 -105
  104. package/dist/storage/migrations/narrowAgentFailureContext.js +0 -65
  105. package/dist/storage/migrations/notificationOnlyWakes.js +0 -74
  106. package/dist/storage/migrations/removeRuntimeGeneration.js +0 -207
  107. package/dist/storage/migrations/submitIntent.js +0 -126
  108. package/dist/storage/migrations/unifyHomeLayout.js +0 -925
  109. package/dist/storage/migrations/verificationPlanV1.js +0 -162
  110. package/dist/storage/migrations/verificationPolicy.js +0 -74
  111. package/dist/storage/migrations/workItemHistory.js +0 -46
@@ -34,7 +34,7 @@ export function isTaskOwnedWorkspace(workspace, taskId, taskRoot, bindings) {
34
34
  export function createManagedWorkspace(input, now) {
35
35
  const timestamp = now.toISOString();
36
36
  return validateManagedWorkspace({
37
- schemaVersion: 2,
37
+ schemaVersion: 1,
38
38
  owner: validateOwner(input.owner),
39
39
  root: resolve(requireText(input.root, "Managed workspace root")),
40
40
  entries: normalizeEntries(input.entries),
@@ -43,8 +43,8 @@ export function createManagedWorkspace(input, now) {
43
43
  });
44
44
  }
45
45
  export function validateManagedWorkspace(workspace) {
46
- if (workspace.schemaVersion !== 2) {
47
- throw new Error("Managed workspace must use schemaVersion 2.");
46
+ if (workspace.schemaVersion !== 1) {
47
+ throw new Error("Managed workspace must use schemaVersion 1.");
48
48
  }
49
49
  validateOwner(workspace.owner);
50
50
  if (resolve(requireText(workspace.root, "Managed workspace root")) !==
@@ -61,13 +61,28 @@ Writable Projects come from the Run's captured effective authority; live
61
61
  activity is a separate observation, not part of the frozen contract.
62
62
  Expansion always requires both `store` and `refId`, even for a unique id.
63
63
 
64
- Historical Run records without a Snapshot remain readable through `run show`
65
- for audit, but cannot supply execution Context, be submitted or retried.
66
- Missing/drifted Snapshot evidence fails explicitly; it is never synthesized
67
- from today's Task. Subsequent observed/steered input records may legitimately
68
- omit their own Snapshot because they do not establish a new Assignment.
69
- No stored layout or payload changes: storage remains 37 with the complete
70
- 1→37 migration chain unchanged.
64
+ New Task execution requires an initial Snapshot. Missing evidence does not make
65
+ a retained Run unreadable: inspection, failure settlement and explicit retirement
66
+ remain available to Leader/Operator, and unrelated work can proceed. Submission
67
+ and exact frozen-context reads fail locally when that evidence is absent or has
68
+ drifted. An explicit ordinary retry creates a new Run and Snapshot from current
69
+ authorized facts, without reconstructing the old snapshot; Review and synthesis
70
+ reuse still require exact frozen evidence. Subsequent observed/steered input may
71
+ omit its own Snapshot because it does not establish a new Assignment.
72
+ Storage uses the 1.0 baseline; the independent converter preserves these records
73
+ without making missing optional execution evidence a Home-wide blocker.
74
+
75
+ Operational failures are scoped to their owner, not treated as proof that the
76
+ whole Controller must stop. Optional resource reaping and continuation metadata
77
+ checks report failures without blocking normal scheduling. Provider retry
78
+ admission is isolated per Session; continuation observation is isolated per Task.
79
+ Job and Global input errors identify their Task/Job or Role and retain the
80
+ original cause. Committed observations stay committed; failed observations do
81
+ not acknowledge input, imply quiescence, or authorize another send or deletion.
82
+ Use the existing status, stop/cancel, retire, acknowledge and explicit retry
83
+ operations for the affected owner. Structural storage corruption, authority
84
+ failure and unconfirmed external effects still require diagnosis at their
85
+ respective boundaries, not a catch-all default or synthetic successful result.
71
86
 
72
87
  Current Task reads also expose untargeted user/Operator messages to the Task's
73
88
  current Worker and Reviewer Sessions, including requirements added after their
@@ -148,13 +163,10 @@ channel once; Worker/Reviewer failures use the existing Leader channel. No new
148
163
  recovery Agent is started, and there need not be a Run or Session to record the
149
164
  failure.
150
165
 
151
- Storage 35→36 archives original historical error payloads and marks their
152
- unrecorded launch configuration as unavailable. It never reconstructs old model,
153
- account or settings choices from current Roles.
154
-
155
- Storage 36→37 narrows that context to native metadata selectors and the requested
156
- model/effort. Full old snapshots remain in migration audit, not in the active
157
- reader. Reading a failure's model options does not validate Task permissions,
166
+ Failure context records native metadata selectors and the requested model/effort.
167
+ Unrecorded configuration stays unavailable; it is never reconstructed from current
168
+ Roles. Opaque audit bytes are not read as current configuration.
169
+ Reading a failure's model options does not validate Task permissions,
158
170
  Review state, workspace entries or the current Session bootstrap protocol.
159
171
  The three failure ingresses retain their native fencing/classification, while
160
172
  record creation and deduplication share one writer and supervisor notices use
@@ -50,11 +50,21 @@ Task 记录。聚合执行从该 Snapshot 读取已选择的 Producer 结果;
50
50
  Run 捕获的生效授权。当前活动状态仍是独立观察,不属于冻结合同。
51
51
  展开引用必须同时指定 `store` 与 `refId`,即使 id 唯一也不能省略 store。
52
52
 
53
- 缺少 Snapshot 的历史 Run 仍可通过 `run show` 审计,但不能提供执行 Context、
54
- 提交给 Provider 或用于重试。Snapshot 缺失或漂移时明确失败,不用今天的 Task
55
- 事实补造历史。后续观察到的原生输入或 steer 记录可以没有独立 Snapshot,因为
56
- 它们不建立新的 Assignment。本次不改变存储布局或记录载荷:storage 仍为 37,
57
- 完整的 1→37 迁移链保持不变。
53
+ 新的 Task 执行需要首个 Snapshot。保留的 Run 缺失执行证据时,仍可供
54
+ Leader/Operator 查看、结算失败或显式废弃,无关工作继续推进。提交执行和读取
55
+ 确切冻结上下文在证据缺失、漂移时局部失败。显式普通重试根据当前授权事实创建
56
+ 新的 Run 和 Snapshot,不补造旧快照;Review/结果汇总的确切复用仍需冻结证据。
57
+ 后续原生输入或 steer 可以没有独立 Snapshot,因为它们不建立新的 Assignment。
58
+ 存储采用 1.0 基线;独立转换器保留这些记录,不把可选执行证据缺失扩大为
59
+ 整个 Home 的转换阻塞。
60
+
61
+ 运行异常按所属对象限制影响,不等同于整个 Controller 必须停摆。可选的资源回收
62
+ 和 continuation 元数据检查失败会报告诊断,不阻断正常调度;Provider 重试准入
63
+ 按 Session 隔离,continuation 观察按 Task 隔离。Job 和全局输入错误包含
64
+ Task/Job 或 Role 身份,并保留原始原因。已提交的观察仍然有效,失败的观察不代表
65
+ 输入已确认、进程已停止,也不授权再次发送或删除。对受影响对象使用既有的查看、
66
+ 停止/取消、废弃、确认和显式重试入口。存储结构损坏、权限失败及未知外部效果,
67
+ 仍在各自边界明确诊断,不用统一兜底值或伪造成功绕过。
58
68
 
59
69
  当前 Task 读取也会把无定向目标的 user/Operator 消息暴露给该 Task 当前的 Worker 和
60
70
  Reviewer Session,包括在它们 Run 快照冻结之后新增的需求。用 `task message list/show`
@@ -122,11 +132,9 @@ retry 把被拒绝批次及后续排队输入交回现有 mailbox,不把旧 wa
122
132
  错误通过既有 Operator 通道通知一次;Worker/Reviewer 仍通知 Leader。不启动新的
123
133
  恢复 Agent,也不为了记录错误制造 Run 或 Session。
124
134
 
125
- 存储 `35→36` 迁移保留历史错误原始 payload,并将当时未记录的启动配置标为不可用,
126
- 不会从当前 Role 猜测过去的模型、账户或 settings 选择。
127
-
128
- 存储 `36→37` 将该上下文收窄为原生元数据查询选项和请求的模型/effort。旧完整快照
129
- 留在迁移审计中,不由运行时双读。查看模型选项不再校验 Task 权限、Review 状态、
135
+ 错误上下文记录原生元数据查询选项和请求的模型/effort。未记录的配置保持不可用,
136
+ 不会从当前 Role 猜测过去的选择,也不会把不透明审计字节当作当前配置读取。
137
+ 查看模型选项不校验 Task 权限、Review 状态、
130
138
  工作区条目或当前 Session 引导协议。三类错误入口保留各自的原生身份检查与分类,
131
139
  错误创建、去重统一一个写入入口,上级通知统一使用事件路由边界。
132
140
 
@@ -27,301 +27,54 @@ system sits behind `ReleaseWorkflowPorts`
27
27
  external ports exercise recovery without real GitHub, npm, git, Controller,
28
28
  or model effects.
29
29
 
30
- ## Final historical bridge: 0.16.2
31
-
32
- | Release | Home storage | Responsibility |
33
- | --- | --- | --- |
34
- | **0.16.2** | Historical v37, supported floor v1 | Last complete historical upgrade chain (v1 through v37). |
35
- | **1.0.0-alpha.1** (planned) | A distinct new 1.0 baseline | Publish an independent, explicit offline converter from verified historical v37. |
36
- | **1.0.0** (planned) | The same verified 1.x contract as the final prerelease | Remove converter source after durable publication; never reset storage again. |
37
-
38
- 0.16.2 supersedes the 0.99.0 release designation without reverting its functional
39
- changes or Git history. Both use the same v37 endpoint. Publish and verify this
40
- replacement before withdrawing the 0.99.0 registry version, Release and tag.
41
- Do not automatically downgrade a local installation or change its Home.
42
- Stable releases explicitly publish to npm `latest`; prereleases publish to
43
- `next`, so the new baseline is opt-in.
44
-
45
- 0.16.2 freezes the historical endpoint at **37**. It does not append a no-op
46
- migration, rewrite released SQL/data migrations, reset record-local schema or
47
- protocol versions, or reinterpret historical evidence. Fresh and upgraded Homes
48
- use the same contract. Ordinary opens still reject historical formats; only
49
- explicit `upgrade` / `update` may migrate them.
50
-
51
- ### Select the bridge explicitly
52
-
53
- In 0.16.2, `yui update --version 0.16.2` selects an exact published
54
- package; no argument still selects `latest`. Tags and ranges are not accepted
55
- as explicit selectors. The actual staged version must equal the requested
56
- version before preflight or Controller handover. A mismatch cleans only the
57
- owned staging prefix, leaving the installed binary and database unchanged.
58
-
59
- Older CLIs do not acquire this option until updated. Once 0.16.2 is published,
60
- use a separately staged, exact 0.16.2 CLI to drive the update against an explicit
61
- `YUI_HOME`. For example, npm can stage it without replacing the global install:
62
-
63
- ```sh
64
- YUI_HOME=/absolute/path/to/home npm exec --yes --package=@zq-silk/yui@0.16.2 -- \
65
- yui update --version 0.16.2
66
- ```
67
-
68
- Do not replace the live global binary first or assume `latest` will continue
69
- to select the bridge. Preserve target-owned `upgrade --update-preflight` /
70
- `--update-apply`: refusal happens before activation, and preflight is repeated
71
- under the handover fence after draining the exact Controller. The older-updater
72
- recovery guidance below still applies when invoking an older updater.
73
-
74
- ### Inspect and preserve the old endpoint
75
-
76
- With the published 0.16.2 CLI and the intended `YUI_HOME`, use the existing
77
- `yui --json version`, `yui --json upgrade --dry-run`, `yui --json doctor`,
78
- `yui --json controller status`, and `yui session reconcile --report` reads.
79
- After the old-chain upgrade, the upgrade report must be `already-current` at
80
- storage 37; `upgrade-plan` only describes pending migrations. Neither report
81
- proves physical quiescence or readiness for the new storage 1.0 cutover.
82
- Do not add a durable "ready for 1.0" flag or a second version authority.
83
-
84
- Before the later offline cutover, settle active work using its original
85
- contract. `yui session stop --all` explicitly stops idle managed Sessions and
86
- the Controller; it is not a force stop or proof that detached Jobs and unknown
87
- resources have exited. Inspect exact ownership and pending effects. Never mark
88
- Tasks complete, acknowledge uncertain work, or delete resources just to pass an
89
- upgrade. The future converter must recheck quiescence under its fence.
90
-
91
- Retain the **exact published 0.16.2 package**, its existing release manifest,
92
- registry integrity, tag/source commit, and this guide as the historical bridge.
93
- The existing package inventory pins compiled migrations and their helpers;
94
- an expiring CI artifact alone is not a long-term distribution. This release
95
- introduces no additional Home metadata or migration registry.
96
-
97
- The 1.0.0-alpha.1 converter must preserve old ledger/audit bytes, Home identity,
98
- business IDs, records, Knowledge, workspaces (including dirty files), and
99
- unconfirmed external effects. A database-only backup cannot fully roll back old
100
- layout migrations with filesystem/Git effects. Unknown or malformed old formats
101
- remain blockers. New storage 1.0 must have a distinct baseline identity, never the old
102
- `v0.15.0-baseline`. Its SQL/fingerprint and final conversion tool belong to
103
- 1.0.0-alpha.1, **not this release**; it accepts verified old v37 rather than carrying
104
- the complete old chain.
105
-
106
- The new storage uses major.minor versions; default upgrades allow only explicit,
107
- contiguous minor steps within the same major. Any persistent change during
108
- prereleases must declare a new minor transition, never silently rewrite a
109
- published baseline. The stable release reuses the final verified contract.
110
- Publish the converter and checksum as durable prerelease attachments before
111
- removing their source. Never include conversion code in the runtime tarball or imports, retaining current
112
- initialization, validation, unknown-format rejection, exact runtime identity and
113
- normal safety/recovery. Users skipping the bridge must still use the frozen
114
- tools; 1.0.0 must never guess an old format.
115
-
116
- ## Controller handover fix in 0.16.1
117
-
118
- Controller status and storage preflight are observations, not cleanup. The
119
- authorized updater explicitly runs its bounded current-Home reconciliation
120
- under the handover fence before capture/stop. It retains the existing four-pass
121
- rule and process-start/inode checks, preserving current Controllers and excluding
122
- Agent/tmux/app/foreign-Home resources.
123
-
124
- Update results and release-step logs retain reconciliation targets, completed
125
- actions, original cleanup errors, the last inventory with its observation time,
126
- and failed observations or lock release. Captured-identity restoration reports
127
- success or unknown effects separately. An uncertain cleanup/restore is not a
128
- stopped Controller or replayable failure; inspect the exact resource before
129
- choosing recovery. No new recovery worker or persistent protocol is introduced.
130
- The staged `--update-preflight` / `--update-apply` contract is unchanged.
131
-
132
- The updater's stop and exact-identity restoration children now explicitly receive
133
- the parent updater's handover-lock owner identity. They no longer wait on their
134
- own parent's lock; unrelated callers remain fenced. Storage remains at version 37.
135
-
136
- An already-installed older updater, including 0.15.12 or 0.16.0, cannot gain this
137
- fix merely by staging the new package. If it reports `CONTROLLER_HANDOVER_TIMEOUT`
138
- before activation, inspect the original Controller and lock ownership. Once the
139
- failed updater has released its own lock and the original Controller is confirmed
140
- healthy, normally stop it with that installed release's `yui controller stop`,
141
- then retry `yui update`. This preserves managed Agent Sessions and retains the
142
- normal preflight, backup, migration and verification boundaries. Do not delete
143
- an active lock or force-kill a Controller to bypass the failure.
144
-
145
- ## Pre-1.0 contract cleanup
146
-
147
- Version 0.16.0 retires runtime compatibility before the final
148
- 1.0 baseline cutover. It does not reset storage numbering.
149
- Storage 27→28 normalizes only provable singleton Role dispatch dedupe keys;
150
- the old migration ledger, Messages, Task results and unconfirmed effects remain
151
- unchanged. Ordinary opens require storage 37. Existing Homes advance only through
152
- the explicit upgrade boundary; no runtime dual-reader is added.
153
-
154
- This is a breaking pre-1.0 change:
155
-
156
- - `message send` uses `--intent`; `--wake-policy` is no longer accepted by the
157
- CLI or capability API. Draft edits preserve intent.
158
- - Internal command integrations implement `notifyMailboxChanged`; the Task-only
159
- notification adapter has been removed with its callers updated.
160
- - ACP peers must report `configOptions`; there is no `modes`/`set_mode` path.
161
- - Release recovery requires a pinned Home and installation prefix. Unpinned
162
- identities remain unknown, and incomplete handover locks remain fenced.
163
- - Development link/unlink requires the current registry. It does not discover
164
- or adopt older NVM registrations or reconstruct orphan links.
165
- - GC no longer discovers retired deployment layouts or reconstructs removed
166
- worktrees. Unsupported quarantine evidence is retained, never purged as if
167
- it were a current move receipt.
168
- - `task activate` consumes an existing request; no request means no resource
169
- adoption. Request creation, deferred admission and atomic workspace adoption
170
- remain separate, using the same current boundary.
171
- - `task integration queue` and its state machine are removed. The Agent chooses
172
- each WorkItem result's order and strategy and calls the atomic Integration
173
- operations; exact checks, target CAS and completion obligations remain.
174
-
175
- Storage 28→29 preserves every former queue payload verbatim in a Task event
176
- `integration.queue-retired`, with its original queue ID, before dropping the
177
- active table. Event IDs advance past both the stored counter and existing
178
- history. This does not accept delivery, generate an Integration or replay work.
179
- Existing Integrations and Jobs stay intact. Inspect `task event list <task>`
180
- and the referenced WorkItem/Integration before deciding what remains to do;
181
- retiring the queue does not settle an unfinished Integration.
182
-
183
- Storage 29→30 retires Run-linked wakes into `wake.run-link-retired` Task events
184
- with the complete original payload. Current notification IDs, delivery status
185
- and references remain intact, using wake schema 2; Run termination no longer
186
- consumes notifications. Live Runs, owned retries and unresolved claims referring
187
- to a retiring wake block both preflight and migration. The migration does not
188
- stop execution or fabricate acceptance. Global Session sets use an explicit
189
- `providerBinding: null` when no controlled binding exists.
190
-
191
- Storage 30→31 makes every Review's scope explicit. Missing/null scope in a valid
192
- older WorkItem Review becomes `work-item`; Task-final candidate evidence and
193
- the old ledger are unchanged. New and retried Reviews always write their scope.
194
-
195
- Storage 31→32 removes WorkItem `historicalState` from the current record.
196
- Before removal, the entire original payload is preserved verbatim in a
197
- `work-item.execution-state-retired` Task event. Current status, scope, Candidates
198
- and execution groups are unchanged; no Run or acceptance is created. Unrecognized
199
- historical shapes fail without changing the record or advancing the ledger.
200
-
201
- Storage 32→33 retires the Leader rollout/budget settings and VerificationPlan
202
- rollout modes. Active plan bodies gain an explicit schema version; their checks
203
- remain unchanged, while retired Knowledge bodies are preserved. Integration
204
- records gain explicit `rerunChecks: false`, and shadow reuse counters are removed
205
- from cached artifacts. Original settings remain recoverable from the explicit
206
- upgrade backup. This is an approved behavior change, not an assertion that
207
- `record`, `reuse` and `enforce` meant the same thing.
208
-
209
- Admitted `running`/`validating` plan gates block preflight and migration; settle
210
- them with the old release first. No in-flight Job is relabelled under the new
211
- proof contract. That cutover's v3 verification-plan digest excluded older cache entries from
212
- automatic reuse without rewriting historical Job/Integration results or deleting
213
- their logs. Historical plan interpretation is frozen inside the migration
214
- directory so earlier migrations keep their original semantics.
215
-
216
- The current clean-candidate proof uses a v5 L2-only execution digest. Both local and
217
- Job-backed verification check candidate cleanliness, branch and exact HEAD
218
- before publishing reusable success; older cache identities cannot silently pass
219
- this boundary. Existing records/logs remain readable and admitted Jobs are not
220
- relabeled under a new digest. Settle old attempts with their matching contract,
221
- or explicitly abandon them before starting another operation.
222
-
223
- The L1 runner, selector and current plan/artifact type branches are removed.
224
- Storage 34→35 archives the original Project plan payloads and L1 artifacts/logs
225
- in `storage_migration_archive`, then adopts VerificationPlan schema 2 without L1.
226
- The archive is raw audit data, not an alternate execution reader or cache.
227
- Settled historical ChangeSet-source Integrations become full-payload Task Events;
228
- live workspaces, unsettled Jobs and adoption references block their retirement.
229
- The complete earlier migration ledger remains unchanged.
230
-
231
- Session custody now has one source, SQLite. Legacy `launch-env` owner rows or
232
- files in `runtime/session-owners` block this cutover: use the old release to
233
- inspect and settle their exact resources, then explicitly archive obsolete
234
- files outside the active Home. The migration does not kill, infer ownership,
235
- repair malformed records or rewrite immutable Session Manifests.
236
-
237
- Storage 35→36 preserves historical Agent errors and explicitly marks missing
238
- failure configuration as unavailable. Storage 36→37 narrows recorded failure
239
- context to native metadata-query inputs, preserving the original snapshot and
240
- empty optional identity placeholders in migration audit. Current error readers
241
- do not depend on the execution snapshot protocol or reconstruct missing history.
242
- Configuration rejection preserves input without automatic retry; an authorized
243
- Agent can inspect failure-scoped model capabilities, correct the intended
244
- configuration, and explicitly retry the rejected notification.
245
-
246
- `task turn` and the `yui-dev` completion identity are no longer supported.
247
- Before rollout, replace Sessions whose old Manifest still names `task turn`,
248
- and explicitly remove/archive old `yui-dev` completion blocks before installing
249
- current `yui` completion. User shell files are never rewritten by storage migration.
250
- Current Host control/event validation and updater handover safety remain enforced.
251
-
252
- Storage 33→34 removes Message `wakePolicy` and activation `origin` from current
253
- records, preserving their original representations in audit Events. Historical
254
- save-only Messages become `intent: record`; other user/operator Messages without
255
- intent become `discuss`. Runtime readers never infer a missing stored intent.
256
- Editing record-only context does not wake the Leader. Completion reads actual
257
- pending message references, including an explicit handoff of previously saved context.
258
-
259
- Draft editing also preserves request identity: messages bound to submission,
260
- queue/steer or handoff requests cannot change body in place. Use a new Message
261
- and request ID; identical-body updates are no-ops. Unkeyed discussion edits
262
- honor pending/failed activation, while develop edits never start planning or
263
- create/retry activation. These are operation-boundary fixes, not a new storage
264
- format or a repair of previously edited historical content.
265
-
266
- An origin-less pending immediate Draft activation blocks preflight and migration,
267
- including on a stopped Task. Activate or cancel it explicitly with the old release
268
- first. An admitted current request needs no second origin gate: cancellation,
269
- planning deferral, execution state and exact Session authority remain enforced.
270
- Old origin metadata, including settled-request history, remains in
271
- `task.activation-origin-retired` Events; this never fabricates authorization.
272
-
273
- New `job start` calls require `--request-id`; RPC callers supply `requestId`, and
274
- the capability boundary supplies its invocation identity. There is no implicit
275
- content-addressed request or anonymous Job constructor. Existing Jobs retain
276
- their operation evidence and remain addressable by ID. Retrying the same explicit
277
- request is idempotent, changed input conflicts, and Integration recovery still
278
- finds its original Job across Session replacement. Choosing a new request ID is
279
- an explicit new operation, not recovery of an uncertain earlier result.
280
-
281
- Core Scheduler readers and persistence operations are required ports. A missing
282
- Session/event reader cannot be interpreted as empty evidence or skipped error
283
- persistence. Task execution and Web projections read the current store directly;
284
- queue admission requires its Task lifecycle read. Exact dispatch settlement
285
- remains separate and does not gain an archive gate that could lose late evidence.
286
- Observer, config, Knowledge and workspace-cleanup Store readers are also required;
287
- test doubles implement those contracts rather than selecting production fallbacks.
288
-
289
- Task listing and `/api/dashboard` now expose only the bounded catalog; remove
290
- `--view compact` from callers and use per-Task reads for detail. Scheduler
291
- catalog projections are required internal ports, not optional full-scan adapters.
292
- Extra `schema.json`/`state.json` files cannot override SQLite's version or be
293
- used to reset a development Home; upgrades leave unrelated files untouched.
294
- A missing database in a non-empty Home remains a refusal to initialize.
295
- Unrecognized writer leases are diagnosed without adoption or deletion.
296
-
297
- `controller status` always reports identity and retains the nonzero health exit
298
- for contradictory storage. `YUI_STATUS_IDENTITY` no longer selects another
299
- contract. Update-owned lifecycle capture uses the same resource collector
300
- directly, without requiring the old Home to pass current-schema health.
301
-
302
- Additional current boundaries:
303
-
304
- - Project/artifact file locks and handover locks require exact process-generation
305
- evidence. Missing/invalid owners or unreadable OS identity remain fenced;
306
- age alone never proves a creator exited. No PID-only positive fallback remains.
307
- - PR head lookup uses one `gh pr list --head ... --state open` query. Only an
308
- empty, valid array proves absence. Transport errors, malformed identities and
309
- multiple matches fail without attempting creation.
310
- - Existing Git operations cannot be adopted without the Integration's original
311
- progress receipt. Preserve their files and diagnose explicitly; current
312
- receipt-backed conflict/Job continuation remains supported.
313
-
314
- Before rollout, settle old executions and use explicit cleanup for unsupported
315
- locks, links or quarantines. Preserve those records until their owner and
316
- disposition are established; the runtime does not choose recovery for them.
317
-
318
- The later baseline cutover must first establish a verified bridge/export to the
319
- chosen current format, then replace the old initialization/migration chain with
320
- one clean baseline. Only then remove pre-baseline migrations and their historical
321
- fixtures. Reset the storage baseline once; do not reset it again when tagging
322
- 1.0.0. Keep unknown-version rejection, exact process/Host identity checks and
323
- durable audit evidence. Version tags and real migration/publication effects
324
- require their separate release authorization.
30
+ ## Clean baseline release: 1.0.0-alpha
31
+
32
+ 0.16.2 remains the frozen historical bridge. The 1.0.0-alpha runtime starts the
33
+ distinct storage **1.0** baseline and carries no old migration chain or
34
+ conversion tool. Package 1.0.0 will reuse the final verified prerelease storage
35
+ contract without another reset.
36
+
37
+ Storage versions have two levels. Default updates may advance only contiguous
38
+ minor versions within the same major; pinning a package does not authorize a
39
+ cross-major conversion. Current Yui-owned envelopes and protocols start at 1,
40
+ without resetting business revisions, epochs or audit evidence.
41
+ Any persistent change after an alpha is published requires an explicit new
42
+ minor transition; published schema definitions must not be silently replaced.
43
+ Current bounded automatic recovery, lock waiting, transactions, replay
44
+ protection and valid exact-identity caches remain normal runtime behavior.
45
+
46
+ Use the exact package version `1.0.0-alpha` to opt into this baseline. Stable
47
+ releases use npm `latest`; prereleases use `next`, never the stable default.
48
+
49
+ The old-v37 converter is a separate archive. Its source/target verification,
50
+ offline boundary, full backup, original-payload audit, cold startup and rollback
51
+ are specified in [Storage baseline 1.0](./storage-baseline.md).
52
+ Publish its archive and checksum as durable 1.0.0-alpha release attachments alongside
53
+ the exact tested runtime package. Expiring CI artifacts alone are insufficient.
54
+ The alpha-only `baseline-release` job runs after npm publication, uploads missing
55
+ attachments to a draft without overwriting existing files, downloads and compares
56
+ every attachment against the tested artifact, then publishes the prerelease.
57
+ A retry verifies matching existing attachments; a different byte or an incomplete
58
+ already-published Release is an error, not permission to replace release evidence.
59
+ If this job fails after npm publication, resume only this job with the same
60
+ retained artifacts rather than republishing or rebuilding the package.
61
+ The runtime tarball must contain neither tools/ nor dist/storage/migrations/.
62
+
63
+ Use `yui update --version <exact-version>` for an exact published package.
64
+ Staged metadata must match the requested version, and target-owned storage
65
+ preflight runs before activation and again under the maintenance fence.
66
+ An unsupported Home remains unchanged; use the independent converter rather
67
+ than replacing the global CLI first. Current update/activation children must
68
+ explicitly identify their handover-lock owner.
69
+
70
+ Restoration checks the captured executable/argv, package version, Controller
71
+ protocol and both storage-version bounds against status and live identity.
72
+ Missing contract fields are errors, not an older-Controller exception.
73
+
74
+ The converter source, frozen endpoint fixture and converter-specific tests are
75
+ release-only deliverables for 1.0.0-alpha. Remove them from the 1.0.0 development line
76
+ only after the 1.0.0-alpha release attachments and checksums are durably available
77
+ and verified. Do not delete the only conversion path before publication.
325
78
 
326
79
  ## Authorization model
327
80
 
@@ -384,8 +137,8 @@ the long-lived Session environment. This preserves pre-adoption evidence even
384
137
  when the frozen Run workspace differs from the Role's default; later activity
385
138
  and terminal facts still resolve solely by their own native input identities.
386
139
 
387
- The current Host boundary is control `yui-agent-host/v5`, event source
388
- `yui-agent-host-events/v1`, and Controller RPC version 4. Hosts do not open the
140
+ The current Host boundary is control `yui-agent-host-control/v1`, event source
141
+ `yui-agent-host-events/v1`, and Controller RPC version 1. Hosts do not open the
389
142
  Home database, including for process custody, native account locations, or
390
143
  execution-environment checks. Only the Controller owns storage and resolves
391
144
  durable facts; malformed current input fails at its normal protocol boundary.
@@ -398,9 +151,8 @@ kill resources of uncertain ownership. Current Controller restart, exact
398
151
  process-generation checks, handover locks, Session authority and event replay
399
152
  protection remain enforced.
400
153
 
401
- Storage migration is separate: the complete 1..37 chain and updater
402
- `--update-preflight` / `--update-apply` contract remain. Storage preflight is
403
- rechecked at the fenced/quiesced boundary; no published migration is rewritten.
154
+ Storage upgrades are limited to the current major's explicit minor steps.
155
+ Cross-major conversion is independently authorized and is not a runtime fallback.
404
156
  Session CLI refresh only retargets the current two-argument quoted wrapper
405
157
  named by a valid Manifest. It does not convert retired wrapper forms. Runtime
406
158
  diagnostics do not interpret `schema.json`, `state.json`, or a whole-map release