@zq-silk/yui 0.15.11 → 0.16.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 (280) hide show
  1. package/ARCHITECTURE.md +11 -6
  2. package/ARCHITECTURE.zh-CN.md +8 -4
  3. package/README.md +13 -5
  4. package/dist/agentRun/agentRun.js +3 -0
  5. package/dist/artifacts/artifactCommitLock.js +16 -55
  6. package/dist/artifacts/taskArtifactRepository.js +3 -3
  7. package/dist/cli/agentConfigurationPicker.js +1 -1
  8. package/dist/cli/commandCatalog.js +92 -48
  9. package/dist/cli/completion.js +18 -18
  10. package/dist/cli/completionWizard.js +1 -1
  11. package/dist/cli/dynamicCompletion.js +1 -1
  12. package/dist/cli/interactionPolicy.js +11 -3
  13. package/dist/cli/invocationAuthority.js +64 -0
  14. package/dist/cli/managedDiagnostics.js +2 -2
  15. package/dist/cli/parseRepeatable.js +35 -0
  16. package/dist/cli/updatePorts.js +26 -5
  17. package/dist/cli.js +1303 -1235
  18. package/dist/commands/agentCommands.js +4 -4
  19. package/dist/commands/capabilityCommands.js +1 -1
  20. package/dist/commands/configCommands.js +6 -57
  21. package/dist/commands/configOverview.js +2 -2
  22. package/dist/commands/durableJobCommands.js +12 -6
  23. package/dist/commands/executionAuditCommands.js +10 -0
  24. package/dist/commands/globalRoleCommands.js +78 -29
  25. package/dist/commands/grantCommands.js +0 -3
  26. package/dist/commands/jobCommands.js +1 -4
  27. package/dist/commands/operatorCommands.js +3 -3
  28. package/dist/commands/projectCommands.js +45 -25
  29. package/dist/commands/resourcesCommands.js +10 -40
  30. package/dist/commands/roleConfiguration.js +2 -6
  31. package/dist/commands/taskActivationCommands.js +4 -8
  32. package/dist/commands/taskAgentCapabilities.js +9 -0
  33. package/dist/commands/taskCommandSupport.js +155 -0
  34. package/dist/commands/taskCommandTypes.js +1 -0
  35. package/dist/commands/taskCommands.js +355 -732
  36. package/dist/commands/taskCompletionGate.js +1 -1
  37. package/dist/commands/taskExecutionCommands.js +1 -1
  38. package/dist/commands/taskFactCommands.js +325 -0
  39. package/dist/commands/taskInputCommands.js +12 -42
  40. package/dist/commands/taskIntegrationCommands.js +20 -58
  41. package/dist/commands/taskNextActionCommand.js +7 -6
  42. package/dist/commands/taskPublicationAdoptCommand.js +127 -0
  43. package/dist/commands/taskPublicationCommands.js +12 -3
  44. package/dist/commands/taskPublicationVerifyCommand.js +24 -40
  45. package/dist/commands/taskRemoteDeliveryCommand.js +5 -86
  46. package/dist/commands/taskUpstreamCommands.js +19 -8
  47. package/dist/commands/workflowCommands.js +6 -1
  48. package/dist/completion/completionInstaller.js +26 -26
  49. package/dist/completion/completionState.js +26 -26
  50. package/dist/completion/fileCompletionManager.js +6 -11
  51. package/dist/config/configCatalog.js +0 -2
  52. package/dist/config/timeZone.js +14 -0
  53. package/dist/config/yuiConfig.js +0 -29
  54. package/dist/context/runContextPack.js +5 -3
  55. package/dist/context/taskCatalog.js +185 -0
  56. package/dist/context/taskContext.js +152 -151
  57. package/dist/context/wakeRunReferences.js +11 -0
  58. package/dist/controller/agentCapabilities.js +58 -0
  59. package/dist/controller/agentRuntimeObserver.js +6 -11
  60. package/dist/controller/clientRuntime.js +22 -14
  61. package/dist/controller/controller.js +20 -24
  62. package/dist/controller/fileSchedulerStoreAdapter.js +191 -225
  63. package/dist/controller/globalInputDelivery.js +13 -0
  64. package/dist/controller/jobClient.js +4 -4
  65. package/dist/controller/jobControl.js +60 -25
  66. package/dist/controller/jobSupervisor.js +4 -4
  67. package/dist/controller/providerRetryAdmission.js +100 -0
  68. package/dist/controller/providerRetryDelivery.js +218 -0
  69. package/dist/controller/runtime.js +85 -43
  70. package/dist/controller/runtimeEventProcessor.js +0 -5
  71. package/dist/controller/sessionOwnerReconciliation.js +5 -0
  72. package/dist/controller/taskAgentError.js +35 -0
  73. package/dist/coordination/workMailboxQueue.js +2 -24
  74. package/dist/core/controllerClient.js +2 -2
  75. package/dist/core/fileLockOwner.js +74 -0
  76. package/dist/decision/decision.js +17 -0
  77. package/dist/doctor/doctor.js +18 -9
  78. package/dist/event/taskEvent.js +12 -0
  79. package/dist/execution/workItemExecutionProjection.js +2 -2
  80. package/dist/executor/agentCapabilityConfig.js +43 -0
  81. package/dist/executor/agentConfigurationCatalog.js +49 -11
  82. package/dist/executor/agentExecutor.js +5 -8
  83. package/dist/executor/fileRoleLaunchPlanner.js +11 -53
  84. package/dist/executor/taskAgentCapabilities.js +64 -0
  85. package/dist/integration/deliveryObligation.js +1 -69
  86. package/dist/integration/gitIntegrationService.js +79 -90
  87. package/dist/integration/integrationAttempt.js +3 -14
  88. package/dist/integration/integrationSourceApplication.js +4 -12
  89. package/dist/integration/manifestTags.js +2 -2
  90. package/dist/job/durableJob.js +4 -25
  91. package/dist/job/jobAssignmentScope.js +22 -0
  92. package/dist/job/jobOperation.js +16 -0
  93. package/dist/job/jobRunner.js +2 -1
  94. package/dist/job/stepDirectory.js +15 -0
  95. package/dist/kernel/builtinCapabilities.js +15 -11
  96. package/dist/kernel/kernelPorts.js +1 -17
  97. package/dist/lifecycle/exactRunTerminalization.js +5 -10
  98. package/dist/message/globalProviderRetry.js +15 -0
  99. package/dist/message/inputControlResolution.js +3 -4
  100. package/dist/message/message.js +17 -20
  101. package/dist/message/messageContinuation.js +1 -1
  102. package/dist/milestone/milestone.js +11 -0
  103. package/dist/observability/executionAudit.js +19 -0
  104. package/dist/observability/orchestrationMetrics.js +24 -1
  105. package/dist/observability/runtimeIdentity.js +1 -17
  106. package/dist/output/agentConfigurationPresentation.js +2 -0
  107. package/dist/output/timePresentation.js +1 -14
  108. package/dist/plugins/pluginService.js +12 -4
  109. package/dist/release/releaseWorkflowPorts.js +45 -96
  110. package/dist/release/runtimeRelease.js +9 -15
  111. package/dist/repository/gitWorkspace.js +371 -105
  112. package/dist/repository/projectMaintenanceLock.js +98 -82
  113. package/dist/repository/taskBaseFreshness.js +1 -1
  114. package/dist/repository/taskWorkspaceCoordinator.js +82 -144
  115. package/dist/repository/taskWorkspacePreparer.js +113 -47
  116. package/dist/repository/workspaceCleanupInspection.js +187 -0
  117. package/dist/resources/autoResourceGc.js +4 -77
  118. package/dist/resources/liveReferences.js +7 -54
  119. package/dist/resources/resourceDiscovery.js +5 -118
  120. package/dist/resources/resourceGc.js +233 -181
  121. package/dist/resources/resourceRegistrar.js +5 -4
  122. package/dist/resources/resourceRegistry.js +3 -37
  123. package/dist/resources/resourceRegistryStore.js +13 -36
  124. package/dist/resources/sqliteResourceRegistry.js +43 -26
  125. package/dist/review/deltaRecheck.js +1 -1
  126. package/dist/review/reviewAcceptance.js +1 -1
  127. package/dist/review/reviewDecision.js +1 -1
  128. package/dist/review/reviewRound.js +8 -7
  129. package/dist/review/taskFinalReviewContractResolution.js +1 -1
  130. package/dist/runtime/acpProtocol.js +4 -51
  131. package/dist/runtime/acpSession.js +10 -75
  132. package/dist/runtime/acpSessionConfiguration.js +1 -8
  133. package/dist/runtime/agentEndpoint.js +3 -2
  134. package/dist/runtime/agentError.js +5 -3
  135. package/dist/runtime/agentFailureContext.js +43 -0
  136. package/dist/runtime/agentHost.js +42 -25
  137. package/dist/runtime/builtinAgentErrorMappers.js +91 -0
  138. package/dist/runtime/codexAppServerRuntime.js +34 -3
  139. package/dist/runtime/codexInteractiveHost.js +2 -2
  140. package/dist/runtime/index.js +0 -1
  141. package/dist/runtime/managedCaller.js +21 -1
  142. package/dist/runtime/providerControl.js +5 -1
  143. package/dist/runtime/providerErrors.js +38 -0
  144. package/dist/runtime/providerRetry.js +198 -0
  145. package/dist/runtime/providerRuntimeIdentity.js +28 -2
  146. package/dist/runtime/runtimeObservation.js +0 -5
  147. package/dist/runtime/runtimeSessionCandidate.js +2 -3
  148. package/dist/runtime/sessionOwnerIdentity.js +1 -1
  149. package/dist/runtime/sessionTokenMetrics.js +15 -5
  150. package/dist/runtime/structuredProviderHost.js +10 -43
  151. package/dist/runtime/taskUsageMetrics.js +275 -0
  152. package/dist/runtime/tmuxAdapters.js +6 -8
  153. package/dist/scheduler/activeRoleRunDelivery.js +19 -7
  154. package/dist/scheduler/leaderWakeupProcessor.js +24 -6
  155. package/dist/scheduler/operatorEvent.js +12 -20
  156. package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
  157. package/dist/scheduler/ports.js +5 -8
  158. package/dist/scheduler/roleRunLiveness.js +4 -4
  159. package/dist/scheduler/roleRunStall.js +16 -23
  160. package/dist/scheduler/taskExecutionProjection.js +49 -36
  161. package/dist/scheduler/taskObservabilityProjection.js +6 -45
  162. package/dist/scheduler/taskWake.js +5 -10
  163. package/dist/scheduler/wakeReason.js +2 -0
  164. package/dist/scheduler/wakeupQueue.js +2 -4
  165. package/dist/setup/setupCommand.js +1 -1
  166. package/dist/storage/contextRecords.js +106 -0
  167. package/dist/storage/currentTaskStore.js +1 -1
  168. package/dist/storage/homeLayout.js +13 -17
  169. package/dist/storage/migrations/agentFailureContext.js +22 -0
  170. package/dist/storage/migrations/currentInputContract.js +86 -0
  171. package/dist/storage/migrations/currentRuntimeContract.js +228 -0
  172. package/dist/storage/migrations/historicalVerificationPlan.js +35 -0
  173. package/dist/storage/migrations/integrationContinuation.js +5 -4
  174. package/dist/storage/migrations/narrowAgentFailureContext.js +65 -0
  175. package/dist/storage/migrations/notificationOnlyWakes.js +74 -0
  176. package/dist/storage/migrations/verificationPlanV1.js +162 -0
  177. package/dist/storage/migrations/verificationPolicy.js +74 -0
  178. package/dist/storage/migrations/workItemHistory.js +46 -0
  179. package/dist/storage/persistenceWorker.js +12 -4
  180. package/dist/storage/recordValidation.js +87 -0
  181. package/dist/storage/sqliteSchema.js +173 -1
  182. package/dist/storage/sqliteStore.js +172 -161
  183. package/dist/storage/storageSchema.js +2 -14
  184. package/dist/storage/storageVersions.js +1 -1
  185. package/dist/storage/storeRpc.js +16 -7
  186. package/dist/storage/taskCatalog.js +123 -0
  187. package/dist/storage/taskStore.js +5 -7
  188. package/dist/storage/upgrade/upgradeOrchestrator.js +25 -37
  189. package/dist/task/archiveDiagnostics.js +1 -0
  190. package/dist/task/archivePreflight.js +124 -0
  191. package/dist/task/completionReadiness.js +5 -24
  192. package/dist/task/draftPlan.js +0 -53
  193. package/dist/task/nextAction.js +7 -13
  194. package/dist/task/publicationAdoption.js +56 -0
  195. package/dist/task/publicationReference.js +10 -0
  196. package/dist/task/remoteDelivery.js +31 -16
  197. package/dist/task/remoteDeliveryService.js +89 -0
  198. package/dist/task/taskActivation.js +2 -25
  199. package/dist/task/taskActivationService.js +0 -2
  200. package/dist/task/taskRecordReference.js +0 -1
  201. package/dist/task/taskSubmission.js +3 -14
  202. package/dist/telemetry/sqliteTelemetryBatch.js +29 -0
  203. package/dist/telemetry/sqliteTelemetryStore.js +49 -49
  204. package/dist/telemetry/telemetryWiring.js +4 -3
  205. package/dist/tmux/tmuxManager.js +29 -20
  206. package/dist/verification/gateArtifact.js +15 -24
  207. package/dist/verification/gateArtifactStore.js +14 -7
  208. package/dist/verification/verificationGateService.js +29 -88
  209. package/dist/verification/verificationPlan.js +27 -72
  210. package/dist/web/assets/client/app.js +92 -17
  211. package/dist/web/assets/client/components.js +55 -13
  212. package/dist/web/assets/client/i18n.js +72 -4
  213. package/dist/web/assets/client/taskSurface.js +6 -5
  214. package/dist/web/assets/client/view.js +35 -7
  215. package/dist/web/assets/shell.js +6 -0
  216. package/dist/web/assets/styles/layout.js +7 -0
  217. package/dist/web/webServer.js +12 -3
  218. package/dist/web/webSnapshot.js +14 -85
  219. package/dist/web/webTaskSurface.js +17 -46
  220. package/dist/workItem/workItem.js +1 -12
  221. package/dist/workspace/cleanupInspection.js +63 -0
  222. package/dist/workspace/workItemChangeSetManager.js +110 -50
  223. package/docs/agent-result-consumption.md +4 -0
  224. package/docs/agent-result-consumption.zh-CN.md +3 -0
  225. package/docs/agent-runtime-drivers.md +7 -0
  226. package/docs/agent-runtime-drivers.zh-CN.md +5 -0
  227. package/docs/architecture/README.md +2 -0
  228. package/docs/architecture/README.zh-CN.md +3 -1
  229. package/docs/architecture/capabilities-and-resources.md +42 -5
  230. package/docs/architecture/capabilities-and-resources.zh-CN.md +33 -3
  231. package/docs/managed-turn-and-session-runtime.md +121 -1
  232. package/docs/managed-turn-and-session-runtime.zh-CN.md +96 -2
  233. package/docs/observability/README.md +62 -0
  234. package/docs/observability/README.zh-CN.md +47 -0
  235. package/docs/plugin-sdk.md +4 -2
  236. package/docs/project-refresh.md +77 -0
  237. package/docs/project-refresh.zh-CN.md +59 -0
  238. package/docs/provider-retry.md +70 -0
  239. package/docs/provider-runtime.md +3 -1
  240. package/docs/provider-runtime.zh-CN.md +4 -2
  241. package/docs/release-workflow.md +190 -7
  242. package/docs/release-workflow.zh-CN.md +139 -5
  243. package/docs/roles-and-configuration.md +29 -0
  244. package/docs/roles-and-configuration.zh-CN.md +21 -0
  245. package/docs/sqlite-control-plane-design.md +16 -3
  246. package/docs/sqlite-control-plane-design.zh-CN.md +13 -2
  247. package/docs/task-dag-semantics.md +3 -3
  248. package/docs/task-dag-semantics.zh-CN.md +2 -2
  249. package/docs/task-delivery.md +223 -17
  250. package/docs/task-delivery.zh-CN.md +171 -14
  251. package/docs/task-discovery.md +101 -0
  252. package/docs/task-discovery.zh-CN.md +85 -0
  253. package/docs/testing/verification-levels.md +161 -9
  254. package/docs/testing/verification-levels.zh-CN.md +116 -9
  255. package/i18n/README.zh-CN.md +13 -7
  256. package/package.json +1 -1
  257. package/skills/yui-leader/SKILL.md +5 -0
  258. package/skills/yui-leader/references/execution.md +3 -2
  259. package/skills/yui-leader/references/integration.md +9 -5
  260. package/skills/yui-leader/references/planning.md +9 -3
  261. package/skills/yui-operator/SKILL.md +24 -8
  262. package/skills/yui-reviewer/SKILL.md +4 -0
  263. package/skills/yui-runtime/SKILL.md +17 -2
  264. package/skills/yui-runtime/references/publication.md +26 -4
  265. package/skills/yui-runtime/references/recovery.md +71 -0
  266. package/dist/agent/agentRegistry.js +0 -10
  267. package/dist/agentRun/runIdentity.js +0 -22
  268. package/dist/commands/deliveryGuardPreflight.js +0 -30
  269. package/dist/commands/taskIntegrationQueueCommands.js +0 -226
  270. package/dist/commands/taskOverviewCommand.js +0 -376
  271. package/dist/completion/completionWizard.js +0 -125
  272. package/dist/context/dispatchContext.js +0 -110
  273. package/dist/context/wakeNotification.js +0 -144
  274. package/dist/integration/integrationCheckEvidenceReuse.js +0 -53
  275. package/dist/integration/integrationQueueEntry.js +0 -191
  276. package/dist/integration/integrationQueueService.js +0 -810
  277. package/dist/release/fakeReleasePorts.js +0 -55
  278. package/dist/runtime/sessionOwnerRegistry.js +0 -137
  279. package/dist/task/deliveryGuard.js +0 -226
  280. /package/dist/{commands/taskActor.js → task/taskAuthority.js} +0 -0
@@ -20,12 +20,193 @@ Two task-level record families back it:
20
20
  exact source (repository + pinned commit, optionally an artifact), an
21
21
  immutable ordered step plan, and one persisted record per step.
22
22
 
23
- The engine (`src/release/releaseWorkflowEngine.ts`) is a pure library; the
23
+ The engine (`src/release/releaseWorkflowEngine.ts`) owns persisted transitions and the workflow lock; the
24
24
  `yui task workflow` and `yui task grant` commands drive it. Every external
25
25
  system sits behind `ReleaseWorkflowPorts`
26
- (`src/release/releaseWorkflowPorts.ts`), so the whole workflow is testable
27
- with deterministic fakes and no real GitHub, npm, git, Controller, or process
28
- side effect.
26
+ (`src/release/releaseWorkflowPorts.ts`). Disposable SQLite and deterministic
27
+ external ports exercise recovery without real GitHub, npm, git, Controller,
28
+ or model effects.
29
+
30
+ ## Pre-1.0 contract cleanup
31
+
32
+ Version 0.16.0 retires runtime compatibility before the final
33
+ 1.0 baseline cutover. It does not reset storage numbering.
34
+ Storage 27→28 normalizes only provable singleton Role dispatch dedupe keys;
35
+ the old migration ledger, Messages, Task results and unconfirmed effects remain
36
+ unchanged. Ordinary opens require storage 37. Existing Homes advance only through
37
+ the explicit upgrade boundary; no runtime dual-reader is added.
38
+
39
+ This is a breaking pre-1.0 change:
40
+
41
+ - `message send` uses `--intent`; `--wake-policy` is no longer accepted by the
42
+ CLI or capability API. Draft edits preserve intent.
43
+ - Internal command integrations implement `notifyMailboxChanged`; the Task-only
44
+ notification adapter has been removed with its callers updated.
45
+ - ACP peers must report `configOptions`; there is no `modes`/`set_mode` path.
46
+ - Release recovery requires a pinned Home and installation prefix. Unpinned
47
+ identities remain unknown, and incomplete handover locks remain fenced.
48
+ - Development link/unlink requires the current registry. It does not discover
49
+ or adopt older NVM registrations or reconstruct orphan links.
50
+ - GC no longer discovers retired deployment layouts or reconstructs removed
51
+ worktrees. Unsupported quarantine evidence is retained, never purged as if
52
+ it were a current move receipt.
53
+ - `task activate` consumes an existing request; no request means no resource
54
+ adoption. Request creation, deferred admission and atomic workspace adoption
55
+ remain separate, using the same current boundary.
56
+ - `task integration queue` and its state machine are removed. The Agent chooses
57
+ each WorkItem result's order and strategy and calls the atomic Integration
58
+ operations; exact checks, target CAS and completion obligations remain.
59
+
60
+ Storage 28→29 preserves every former queue payload verbatim in a Task event
61
+ `integration.queue-retired`, with its original queue ID, before dropping the
62
+ active table. Event IDs advance past both the stored counter and existing
63
+ history. This does not accept delivery, generate an Integration or replay work.
64
+ Existing Integrations and Jobs stay intact. Inspect `task event list <task>`
65
+ and the referenced WorkItem/Integration before deciding what remains to do;
66
+ retiring the queue does not settle an unfinished Integration.
67
+
68
+ Storage 29→30 retires Run-linked wakes into `wake.run-link-retired` Task events
69
+ with the complete original payload. Current notification IDs, delivery status
70
+ and references remain intact, using wake schema 2; Run termination no longer
71
+ consumes notifications. Live Runs, owned retries and unresolved claims referring
72
+ to a retiring wake block both preflight and migration. The migration does not
73
+ stop execution or fabricate acceptance. Global Session sets use an explicit
74
+ `providerBinding: null` when no controlled binding exists.
75
+
76
+ Storage 30→31 makes every Review's scope explicit. Missing/null scope in a valid
77
+ older WorkItem Review becomes `work-item`; Task-final candidate evidence and
78
+ the old ledger are unchanged. New and retried Reviews always write their scope.
79
+
80
+ Storage 31→32 removes WorkItem `historicalState` from the current record.
81
+ Before removal, the entire original payload is preserved verbatim in a
82
+ `work-item.execution-state-retired` Task event. Current status, scope, Candidates
83
+ and execution groups are unchanged; no Run or acceptance is created. Unrecognized
84
+ historical shapes fail without changing the record or advancing the ledger.
85
+
86
+ Storage 32→33 retires the Leader rollout/budget settings and VerificationPlan
87
+ rollout modes. Active plan bodies gain an explicit schema version; their checks
88
+ remain unchanged, while retired Knowledge bodies are preserved. Integration
89
+ records gain explicit `rerunChecks: false`, and shadow reuse counters are removed
90
+ from cached artifacts. Original settings remain recoverable from the explicit
91
+ upgrade backup. This is an approved behavior change, not an assertion that
92
+ `record`, `reuse` and `enforce` meant the same thing.
93
+
94
+ Admitted `running`/`validating` plan gates block preflight and migration; settle
95
+ them with the old release first. No in-flight Job is relabelled under the new
96
+ proof contract. That cutover's v3 verification-plan digest excluded older cache entries from
97
+ automatic reuse without rewriting historical Job/Integration results or deleting
98
+ their logs. Historical plan interpretation is frozen inside the migration
99
+ directory so earlier migrations keep their original semantics.
100
+
101
+ The current clean-candidate proof uses a v5 L2-only execution digest. Both local and
102
+ Job-backed verification check candidate cleanliness, branch and exact HEAD
103
+ before publishing reusable success; older cache identities cannot silently pass
104
+ this boundary. Existing records/logs remain readable and admitted Jobs are not
105
+ relabeled under a new digest. Settle old attempts with their matching contract,
106
+ or explicitly abandon them before starting another operation.
107
+
108
+ The L1 runner, selector and current plan/artifact type branches are removed.
109
+ Storage 34→35 archives the original Project plan payloads and L1 artifacts/logs
110
+ in `storage_migration_archive`, then adopts VerificationPlan schema 2 without L1.
111
+ The archive is raw audit data, not an alternate execution reader or cache.
112
+ Settled historical ChangeSet-source Integrations become full-payload Task Events;
113
+ live workspaces, unsettled Jobs and adoption references block their retirement.
114
+ The complete earlier migration ledger remains unchanged.
115
+
116
+ Session custody now has one source, SQLite. Legacy `launch-env` owner rows or
117
+ files in `runtime/session-owners` block this cutover: use the old release to
118
+ inspect and settle their exact resources, then explicitly archive obsolete
119
+ files outside the active Home. The migration does not kill, infer ownership,
120
+ repair malformed records or rewrite immutable Session Manifests.
121
+
122
+ Storage 35→36 preserves historical Agent errors and explicitly marks missing
123
+ failure configuration as unavailable. Storage 36→37 narrows recorded failure
124
+ context to native metadata-query inputs, preserving the original snapshot and
125
+ empty optional identity placeholders in migration audit. Current error readers
126
+ do not depend on the execution snapshot protocol or reconstruct missing history.
127
+ Configuration rejection preserves input without automatic retry; an authorized
128
+ Agent can inspect failure-scoped model capabilities, correct the intended
129
+ configuration, and explicitly retry the rejected notification.
130
+
131
+ `task turn` and the `yui-dev` completion identity are no longer supported.
132
+ Before rollout, replace Sessions whose old Manifest still names `task turn`,
133
+ and explicitly remove/archive old `yui-dev` completion blocks before installing
134
+ current `yui` completion. User shell files are never rewritten by storage migration.
135
+ Host control/event compatibility and updater handover safety remain unchanged.
136
+
137
+ Storage 33→34 removes Message `wakePolicy` and activation `origin` from current
138
+ records, preserving their original representations in audit Events. Historical
139
+ save-only Messages become `intent: record`; other user/operator Messages without
140
+ intent become `discuss`. Runtime readers never infer a missing stored intent.
141
+ Editing record-only context does not wake the Leader. Completion reads actual
142
+ pending message references, including an explicit handoff of previously saved context.
143
+
144
+ Draft editing also preserves request identity: messages bound to submission,
145
+ queue/steer or handoff requests cannot change body in place. Use a new Message
146
+ and request ID; identical-body updates are no-ops. Unkeyed discussion edits
147
+ honor pending/failed activation, while develop edits never start planning or
148
+ create/retry activation. These are operation-boundary fixes, not a new storage
149
+ format or a repair of previously edited historical content.
150
+
151
+ An origin-less pending immediate Draft activation blocks preflight and migration,
152
+ including on a stopped Task. Activate or cancel it explicitly with the old release
153
+ first. An admitted current request needs no second origin gate: cancellation,
154
+ planning deferral, execution state and exact Session authority remain enforced.
155
+ Old origin metadata, including settled-request history, remains in
156
+ `task.activation-origin-retired` Events; this never fabricates authorization.
157
+
158
+ New `job start` calls require `--request-id`; RPC callers supply `requestId`, and
159
+ the capability boundary supplies its invocation identity. There is no implicit
160
+ content-addressed request or anonymous Job constructor. Existing Jobs retain
161
+ their operation evidence and remain addressable by ID. Retrying the same explicit
162
+ request is idempotent, changed input conflicts, and Integration recovery still
163
+ finds its original Job across Session replacement. Choosing a new request ID is
164
+ an explicit new operation, not recovery of an uncertain earlier result.
165
+
166
+ Core Scheduler readers and persistence operations are required ports. A missing
167
+ Session/event reader cannot be interpreted as empty evidence or skipped error
168
+ persistence. Task execution and Web projections read the current store directly;
169
+ queue admission requires its Task lifecycle read. Exact dispatch settlement
170
+ remains separate and does not gain an archive gate that could lose late evidence.
171
+ Observer, config, Knowledge and workspace-cleanup Store readers are also required;
172
+ test doubles implement those contracts rather than selecting production fallbacks.
173
+
174
+ Task listing and `/api/dashboard` now expose only the bounded catalog; remove
175
+ `--view compact` from callers and use per-Task reads for detail. Scheduler
176
+ catalog projections are required internal ports, not optional full-scan adapters.
177
+ Extra `schema.json`/`state.json` files cannot override SQLite's version or be
178
+ used to reset a development Home; upgrades leave unrelated files untouched.
179
+ A missing database in a non-empty Home remains a refusal to initialize.
180
+ Unrecognized writer leases are diagnosed without adoption or deletion.
181
+
182
+ `controller status` always reports identity and retains the nonzero health exit
183
+ for contradictory storage. `YUI_STATUS_IDENTITY` no longer selects another
184
+ contract. Update-owned lifecycle capture uses the same resource collector
185
+ directly, without requiring the old Home to pass current-schema health.
186
+
187
+ Additional current boundaries:
188
+
189
+ - Project/artifact file locks and handover locks require exact process-generation
190
+ evidence. Missing/invalid owners or unreadable OS identity remain fenced;
191
+ age alone never proves a creator exited. No PID-only positive fallback remains.
192
+ - PR head lookup uses one `gh pr list --head ... --state open` query. Only an
193
+ empty, valid array proves absence. Transport errors, malformed identities and
194
+ multiple matches fail without attempting creation.
195
+ - Existing Git operations cannot be adopted without the Integration's original
196
+ progress receipt. Preserve their files and diagnose explicitly; current
197
+ receipt-backed conflict/Job continuation remains supported.
198
+
199
+ Before rollout, settle old executions and use explicit cleanup for unsupported
200
+ locks, links or quarantines. Preserve those records until their owner and
201
+ disposition are established; the runtime does not choose recovery for them.
202
+
203
+ The later baseline cutover must first establish a verified bridge/export to the
204
+ chosen current format, then replace the old initialization/migration chain with
205
+ one clean baseline. Only then remove pre-baseline migrations and their historical
206
+ fixtures. Reset the storage baseline once; do not reset it again when tagging
207
+ 1.0.0. Keep unknown-version rejection, exact process/Host identity checks and
208
+ durable audit evidence. Version tags and real migration/publication effects
209
+ require their separate release authorization.
29
210
 
30
211
  ## Authorization model
31
212
 
@@ -214,9 +395,11 @@ The key is passed to every `executeStep` call for that step, including
214
395
  retries after a confirmed-absent timeout. The port contract requires
215
396
  `executeStep` to be idempotent under the same key: a retried attempt must not
216
397
  produce a second side effect. The engine side of the contract is stricter
217
- still — it never calls `executeStep` for a step it has marked `unknown`; it
218
- re-queries by the recorded identity instead. The fakes record every key, so
219
- the test suite proves at-most-once execution directly.
398
+ still — it never blindly calls `executeStep` for an `unknown` step; it first
399
+ re-queries by the recorded identity. A deterministic core scenario checks
400
+ uncertain-effect queries, confirmed-step reuse and grant exhaustion against
401
+ real SQLite. This proves those engine boundaries, not the idempotency of real
402
+ external services or every release adapter.
220
403
 
221
404
  ## Operator guide
222
405
 
@@ -15,10 +15,143 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
15
15
  - **ReleaseWorkflow**(`release-workflow-N`)——计划及其进展:一个确切来源(仓库 +
16
16
  钉住的 commit,可选一个 artifact)、一份不可变的有序步骤计划,以及每步一条持久记录。
17
17
 
18
- 引擎(`src/release/releaseWorkflowEngine.ts`)是一个纯库;`yui task workflow` 和
18
+ 引擎(`src/release/releaseWorkflowEngine.ts`)负责持久状态转换和工作流锁;`yui task workflow` 和
19
19
  `yui task grant` 命令驱动它。每个外部系统都位于 `ReleaseWorkflowPorts`
20
- (`src/release/releaseWorkflowPorts.ts`)之后,因此整个工作流可以用确定性的 fake
21
- 测试,不产生任何真实的 GitHub、npm、git、Controller 或进程副作用。
20
+ (`src/release/releaseWorkflowPorts.ts`)之后。可用临时 SQLite 和确定性的外部端口测试
21
+ 恢复逻辑,无需真实 GitHub、npm、git、Controller 或模型效果。
22
+
23
+ ## 1.0 前的契约清理
24
+
25
+ 版本 `0.16.0` 先清退运行时兼容分支,尚未执行最终 1.0 基线切换,也不重置
26
+ 存储编号。存储 `27→28` 只规范化可明确识别的单条 Role 调度去重键,旧迁移账本、
27
+ Message、Task 结果和不确定外部效果保持不变。普通打开要求存储 37;已有 Home 只通过
28
+ 显式升级入口前进,不增加运行时双读。
29
+
30
+ 这是一次 1.0 前的破坏性变更:
31
+
32
+ - `message send` 统一使用 `--intent`;CLI 与 capability API 不再接受 `--wake-policy`
33
+ 或 `wakePolicy` 参数,Draft 编辑保留原提交意图。
34
+ - 内部命令集成实现 `notifyMailboxChanged`;Task-only 通知适配器及其调用已统一。
35
+ - ACP peer 必须回报 `configOptions`,不再走 `modes`/`set_mode` 路径。
36
+ - Release 恢复要求精确 Home 与安装 prefix。缺少固定目标的效果保持 unknown,
37
+ 身份不完整的 handover lock 保持围栏。
38
+ - 开发 link/unlink 要求当前登记文件,不搜索或接管旧 NVM 登记,不重建孤立链接。
39
+ - GC 不再发现旧 deployment 布局或重建已删除 worktree;不受支持的 quarantine
40
+ 证据保留,不会被当成当前 move 回执清除。
41
+ - `task activate` 只消费已有请求;没有请求就不采用资源。请求创建、延后准入和
42
+ 原子工作区采用仍分开,并复用同一个现行执行边界。
43
+ - 删除 `task integration queue` 及其状态机。Agent 选择每个 WorkItem 结果的顺序与
44
+ 策略,逐项调用原子 Integration;保留精确检查、目标 CAS 和完成义务。
45
+
46
+ 存储 `28→29` 在删除活动队列表前,将每条旧 payload 原样保存在
47
+ `integration.queue-retired` Task 事件中,并保留原队列 ID。事件编号越过已有计数器
48
+ 和历史最大 ID。此操作不验收交付、不生成 Integration、不重放工作;已有 Integration
49
+ 与 Job 保持不变。通过 `task event list <task>` 和引用的 WorkItem/Integration
50
+ 判断剩余工作;队列退役不代表未完成的 Integration 已结算。
51
+
52
+ 存储 `29→30` 将 Run-linked wake 的完整原文移入 `wake.run-link-retired` Task 事件。
53
+ 现有通知保留 ID、投递状态和引用,使用 wake schema 2;Run 终态不再消费通知。
54
+ 引用待退役 wake 的活动 Run、受管重试或未决 claim 会同时阻止预检和迁移;
55
+ 迁移不停止执行、不编造接受。Global Session 没有受控 binding 时统一显式保存
56
+ `providerBinding: null`。
57
+
58
+ 存储 `30→31` 将 Review scope 统一为显式值:有效旧 WorkItem Review 的缺失/null
59
+ scope 转为 `work-item`,Task-final 候选证据和原迁移账本不变。新建和重试均显式写入 scope。
60
+
61
+ 存储 `31→32` 从当前 WorkItem 移除 `historicalState`,移除前将完整原始 payload
62
+ 原样保存在 `work-item.execution-state-retired` Task 事件。当前状态、工作范围、
63
+ Candidate 和执行组不变,不生成 Run 或验收。未知历史形态会报错,记录和迁移账本不前进。
64
+
65
+ 存储 `32→33` 清退 Leader 过渡/预算配置以及 VerificationPlan 的模式。
66
+ 活动计划显式补上 schema 版本,实际检查保持不变;已退役 Knowledge 原文保留。
67
+ Integration 显式补入 `rerunChecks: false`,缓存 Artifact 移除试运行复用计数。
68
+ 原配置可从显式升级备份恢复。这是已确认的行为变更,不将三种旧模式声称为等价。
69
+
70
+ 已接纳且仍为 `running/validating` 的计划验证会阻止预检和迁移,需先用旧版本完成
71
+ 结算;不会把运行中的 Job 改标为新证据契约。该次切换使用 v3 验证摘要,使更早缓存不再被
72
+ 自动复用,不重写历史 Job/Integration 结果或删除其日志。旧计划解析冻结在迁移
73
+ 目录中,早期迁移保持原有语义。
74
+
75
+ 现行干净候选证明采用 v5 L2-only 执行摘要。Job 和本地验证都在发布可复用成功前,
76
+ 检查候选工作区的干净状态、分支和精确 HEAD;旧缓存身份不能绕过这一边界。
77
+ 旧记录和日志保持可读,已接纳 Job 不会被改标为新摘要。应先按原契约结算旧尝试,
78
+ 或明确放弃后再开始新操作。
79
+
80
+ L1 执行入口、选择器及当前计划/artifact 类型分支已移除。存储 `34→35` 将
81
+ 原始 Project 计划、L1 artifact 与日志保存在 `storage_migration_archive`,
82
+ 当前计划改为不含 L1 的 schema 2。存档只是原始审计数据,不是执行 reader 或缓存。
83
+ 已结算的旧 ChangeSet-source Integration 转为完整 payload 的 Task 事件;
84
+ 仍有工作区、未结算 Job 或 adoption 引用时阻止退休。旧迁移账本不变。
85
+
86
+ Session 归属统一使用 SQLite。旧 `launch-env` owner 行或 `runtime/session-owners`
87
+ 中的文件会阻止切换:先使用旧版本检查并释放精确资源,再明确将旧文件归档到
88
+ 活动 Home 之外。迁移不杀进程、不推断归属、不修复损坏数据,也不重写不可变 Manifest。
89
+
90
+ 存储 `35→36` 保留历史 Agent 错误,并将缺失的失败配置明确标为不可用。
91
+ 存储 `36→37` 将已记录的失败上下文缩小为原生元数据查询所需输入,原始快照和
92
+ 空的可选身份占位值保存在迁移审计中。当前错误读取不依赖执行快照协议,也不
93
+ 重建缺失历史。配置拒绝保留原始输入但不自动重试;有权限的 Agent 可查询该次
94
+ 失败的模型能力、修正原本要求的配置,再显式重试被拒绝的通知。
95
+
96
+ 不再支持 `task turn` 和 `yui-dev` 补全身份。上线前应替换仍依赖 `task turn`
97
+ Manifest 的 Session;明确卸载/归档旧 `yui-dev` 补全块后,再安装现行 `yui` 补全。
98
+ 存储迁移不会修改用户 shell 文件。Host 控制/事件兼容与 updater 交接安全检查保持不变。
99
+
100
+ 存储 `33→34` 从当前记录移除 Message `wakePolicy` 与激活 `origin`,原始表达
101
+ 保存在审计事件。旧的仅记录消息转换为 `intent: record`,其他缺少意图的
102
+ user/operator 消息转换为 `discuss`;运行时不再解释缺失的持久化意图。
103
+ 编辑仅记录内容不会唤醒 Leader。完成检查读取实际待投递消息引用,也涵盖显式交接
104
+ 此前仅保存的内容。
105
+
106
+ Draft 编辑同时保护请求身份:已经绑定 submission、queue/steer 或交接请求的消息
107
+ 不能原地改正文,需新建消息并使用新请求 ID;相同正文更新为无操作。未绑定请求
108
+ 身份的讨论编辑仍遵守 pending/failed 激活状态,develop 编辑不启动规划或创建/
109
+ 重试激活。这是操作边界修复,不改变存储格式,也不猜测修复过去已被编辑的原文。
110
+
111
+ Draft 中缺少 origin 且仍 pending 的旧 immediate 激活请求会阻止预检和迁移,即使 Task
112
+ 已停止执行。必须先用旧版本显式激活或取消;升级不替用户做这个决定。当前已接纳
113
+ 请求不再经过第二次来源门槛,但取消、planning 延后、执行状态与精确 Session 权限
114
+ 仍需检查。旧来源及 settled 请求历史保留在 `task.activation-origin-retired` 事件。
115
+
116
+ 新 `job start` 必须带 `--request-id`;RPC 必须提供 `requestId`,capability
117
+ 入口使用 invocation 身份。不再从命令内容隐式生成请求,也不再构造匿名 Job。
118
+ 已有 Job 的操作证据和按 ID 读取保持不变;相同请求重试防重、不同输入冲突,
119
+ Integration 在 Session 替换后仍找回原 Job。新 request ID 表示明确的新操作,
120
+ 不是对旧未知结果的自动重放。
121
+
122
+ Scheduler 核心读取和持久化操作成为必需接口,缺少 Session/Event 读取不再被当作
123
+ 空证据,也不能跳过错误持久化。执行及 Web 投影直接读取当前 Store;
124
+ 消息入队必须读取 Task 生命周期。精确投递结算仍独立,不增加会丢失迟到证据的归档门槛。
125
+ Observer、配置、Knowledge 与工作区清理所需 Store 读取也成为必需接口;
126
+ 测试替身实现现行合同,不再令生产代码降级。
127
+
128
+ Task 列表及 `/api/dashboard` 只保留有界目录;调用方去掉 `--view compact`,
129
+ 详情使用单 Task 读取。Scheduler 目录索引是必需接口,不再兼容缺失时的全量扫描。
130
+ 额外 `schema.json`/`state.json` 不覆盖 SQLite 版本,也不用于开发 Home reset;
131
+ 升级保留无关文件。非空 Home 缺少数据库时仍拒绝初始化。
132
+ 不认识的 writer lease 明确诊断,不接管、不删除。
133
+
134
+ `controller status` 固定输出身份信息,存储矛盾仍返回非零健康退出码;
135
+ `YUI_STATUS_IDENTITY` 不再选择另一套契约。升级侧直接复用资源采集器读取生命周期,
136
+ 无需让旧 Home 先通过当前 schema 的健康校验。
137
+
138
+ 现行边界进一步收敛:
139
+
140
+ - Project/Artifact 文件锁及 handover lock 要求精确进程代际证据。owner 缺失、
141
+ 格式不完整或 OS 身份不可读时保持围栏;仅凭年龄不能证明创建者退出,不再用
142
+ PID-only 存活判断代替身份确认。
143
+ - PR head 查询只调用 `gh pr list --head ... --state open`。仅有效空数组证明不存在;
144
+ 传输失败、身份格式错误和多个匹配都不允许继续创建。
145
+ - 已有 Git 操作缺少原 Integration 进度回执时不再被接管。保留文件并明确诊断;
146
+ 有精确回执的正常冲突/Job 续作仍受支持。
147
+
148
+ 发布前应先收敛旧执行,对不受支持的锁、链接和隔离资源做显式清理。归属与处置尚未
149
+ 确定时保留原记录,运行时不替 Agent 选择恢复方案。
150
+
151
+ 后续基线切换必须先验证到目标格式的桥接或导出,再用一个干净基线替换旧初始化和迁移链,
152
+ 之后才能删除基线之前的迁移及历史夹具。存储基线只重置一次,不在发布 `1.0.0` 时再次
153
+ 重置。未知版本拒绝、精确进程/Host 身份检查与持久审计证据仍应保留。版本 tag、真实
154
+ Home 迁移和发布效果需要各自的发布授权。
22
155
 
23
156
  ## 授权模型
24
157
 
@@ -165,8 +298,9 @@ kind、可选 params,以及一个可选的不可逆级别(`none` | `reversib
165
298
 
166
299
  该键被传给该步骤的每一次 `executeStep` 调用,包括在一次确认为 absent 的超时之后的
167
300
  重试。端口合同要求 `executeStep` 在同一键下是幂等的:一次重试尝试不得产生第二次
168
- 副作用。引擎侧的合同更严格——它绝不为一个已标记 `unknown` 的步骤调用 `executeStep`,
169
- 而是按记录的身份重新查询。fake 记录每一个键,因此测试套件直接证明至多一次执行。
301
+ 副作用。引擎不会盲目为 `unknown` 步骤调用 `executeStep`,而是先按记录的身份查询。
302
+ 核心测试用真实 SQLite 和确定性端口检查不确定效果查询、已确认步骤复用和 grant 次数耗尽。
303
+ 这证明这些引擎边界,不代表真实外部服务或所有发布适配器的幂等性已被验证。
170
304
 
171
305
  ## Operator 指南
172
306
 
@@ -93,10 +93,20 @@ services. Isolating `YUI_HOME` or replacing a Session does not require a fresh
93
93
  native account directory. Managed Task execution uses Claude's non-interactive
94
94
  stream-json path with the same native configuration ownership.
95
95
 
96
+ Model catalogs are native observations, not a universal Provider whitelist.
97
+ Yui displays the selectable ID/alias and its reported resolved model. An explicit
98
+ custom ID is passed unchanged when the native model field allows custom values;
99
+ this does not prove that the Provider will accept it. Known model-specific effort
100
+ limits are still validated. Configuration rejection reports the observed model
101
+ options and how to inspect the full catalog; an unavailable catalog is not
102
+ replaced by a fabricated list.
103
+
96
104
  ## Commands
97
105
 
98
106
  ```sh
99
107
  yui config agent capabilities <agent-id>
108
+ yui task role capabilities <task> <role> --refresh
109
+ yui task role capabilities <task> <role> --error <error-event-id> --refresh
100
110
  yui config role show <global-role>
101
111
  yui config profile show <profile>
102
112
  yui task role add <task> <role> --profile <profile>
@@ -107,6 +117,25 @@ yui task role session inspect <task> <role>
107
117
  yui task role session new <task> <role> --reason "<why a fresh Session is useful>"
108
118
  ```
109
119
 
120
+ The global query uses the calling process's default native context. Task-scoped
121
+ queries use the Controller's native account environment and the selected Role
122
+ configuration; they never forward the caller's credentials to another Provider.
123
+ Omitting `--error` selects the current desired Role. With `--error`, the recorded
124
+ failed request supplies model, workspace and profile/settings options even after
125
+ the Role changes. A changed configured Agent command/environment binding or an
126
+ unrecorded historical context produces a diagnosis, not a default substitution.
127
+ Task-scoped metadata queries require a running Controller and do not start one.
128
+
129
+ `--refresh` explicitly re-probes metadata. A failed probe may show a clearly
130
+ marked cached catalog, not claim it is current. Native files and credentials
131
+ are read currently; their secret contents are never snapshotted in error history.
132
+ The lookup reports metadata only, without running a model to test a candidate ID.
133
+
134
+ Completed in-memory catalogs have a bounded least-recently-used cache. Concurrent
135
+ requests for the same scope share the active probe, including refresh requests;
136
+ once it settles, an explicit refresh probes again. Retained results are labelled
137
+ as cached rather than as a new live response. No cleanup timer or worker is added.
138
+
110
139
  On Role creation, explicit Agent settings require `--agent`. On update, omitted
111
140
  `--agent` targets the active binding; a named binding is updated without being
112
141
  activated. `task role bind` changes selection. A live Session requires the
@@ -75,10 +75,17 @@ Claude 自身加载原生设置,并按其生效配置在 API key、既有 help
75
75
  服务。隔离 `YUI_HOME` 或替换 Session 都不要求一个全新的原生账号目录。受管的 Task
76
76
  执行使用 Claude 的非交互 stream-json 路径,并沿用同样的原生配置归属。
77
77
 
78
+ 模型目录是原生观测结果,不是整个 Provider 的模型白名单。Yui 显示可选择的 ID/别名
79
+ 及原生报告的实际模型映射。原生模型字段允许自定义值时,显式模型 ID 会原样透传;
80
+ 这不代表 Provider 已接受该模型。已知模型的 effort 限制仍会校验。配置校验拒绝会显示
81
+ 已观测到的模型选项和完整目录查询方式;目录不可用时,不编造“合法模型列表”。
82
+
78
83
  ## 命令
79
84
 
80
85
  ```sh
81
86
  yui config agent capabilities <agent-id>
87
+ yui task role capabilities <task> <role> --refresh
88
+ yui task role capabilities <task> <role> --error <error-event-id> --refresh
82
89
  yui config role show <global-role>
83
90
  yui config profile show <profile>
84
91
  yui task role add <task> <role> --profile <profile>
@@ -89,6 +96,20 @@ yui task role session inspect <task> <role>
89
96
  yui task role session new <task> <role> --reason "<why a fresh Session is useful>"
90
97
  ```
91
98
 
99
+ 全局查询使用调用进程的默认原生环境;Task 查询使用 Controller 的原生账户环境及
100
+ 所选 Role 配置,不把调用方的凭据转交给其他 Provider。省略 `--error` 查看当前期望
101
+ 配置;指定错误记录时,使用失败时保存的模型、工作区、profile/settings 选项,不受
102
+ 之后的 Role 修改影响。若配置的 Agent 命令/环境绑定已变化,或历史错误未记录配置,
103
+ 返回明确诊断,不替换成默认配置。Task 查询要求 Controller 已运行,不自动启动它。
104
+
105
+ `--refresh` 显式重新查询元数据;查询失败后返回缓存时会标明缓存来源,不冒充当前
106
+ 结果。原生文件及凭据仍按当前值读取,秘密内容不会复制进错误历史。这里只查询
107
+ 元数据,不通过真实模型调用来试验候选名称。
108
+
109
+ 已完成目录使用有容量上限的近期使用缓存;相同上下文的并发请求(包括刷新)共享
110
+ 正在进行的查询,结束后显式刷新才重新查询。缓存命中标为缓存,不冒充新的实时响应。
111
+ 这不增加清理定时器或后台 worker。
112
+
92
113
  创建 Role 时,显式的 Agent 设置需要 `--agent`。更新时,省略 `--agent` 针对活动
93
114
  绑定;一个具名绑定会被更新但不被激活。`task role bind` 更改选择。在更改期望设置
94
115
  之前,活动 Session 需要该命令的显式确认。
@@ -34,6 +34,19 @@ model. A newer, below-minimum, incomplete, or malformed Home fails closed.
34
34
  There is no runtime normalization, repair worker, file-Store fallback, dual
35
35
  read/write path, or second migration authority.
36
36
 
37
+ Typed domain payloads use one current validator registry on writes, ordinary
38
+ reads, bounded Context pages and full-Home diagnostics. Direct and worker-backed
39
+ Stores do not have different validation strength. Invalid records are rejected
40
+ without advancing the revision; an invalid stored record remains available for
41
+ explicit diagnosis, never normalized into a valid-looking replacement.
42
+
43
+ Storage 35 also has a migration-only `storage_migration_archive` table:
44
+ `migration_version / family / record_key / payload / content`. It retains exact
45
+ retired Project/gate payloads and binary logs without interpreting them in the
46
+ current model. It is not scheduling state, a second cache or a runtime fallback.
47
+ Task-scoped historical Integration retirement uses ordinary Task Events.
48
+ Backups retain both current records and this audit archive.
49
+
37
50
  ## Write and concurrency contract
38
51
 
39
52
  - Each mutation is one SQLite transaction.
@@ -69,8 +82,8 @@ Every persistent schema or payload change appends one immutable, contiguous
69
82
  storage migration. The CLI publishes both `storageVersion` and
70
83
  `minimumStorageVersion`; every valid Home in that inclusive range can upgrade
71
84
  directly to the current version without installing intermediate releases.
72
- The current source declares storage version **25**, with minimum supported
73
- migration version **1**, in `src/storage/storageVersions.ts`. Homes below that
85
+ The current version and migration floor are declared only in
86
+ `src/storage/storageVersions.ts` and exposed by CLI identity. Homes below that
74
87
  floor are not migration inputs and remain untouched.
75
88
  The target binary's `upgrade --update-preflight` and `--update-apply` result
76
89
  shapes and parent-owned handover-lock proof remain backward compatible with
@@ -123,7 +136,7 @@ unifying the root does not weaken control-data or cross-owner isolation.
123
136
  **not** a second authority for internal managed paths, and is intentionally not
124
137
  an input to `homeLayout.ts`. A Yui-auto-created Global Role that carries no
125
138
  user-chosen cwd no longer falls back to it (or to `process.cwd()`): `yui setup`'s
126
- built-in Operator/Leader and `yui role add` without `--workspace` now default to
139
+ built-in Operator/Leader and `yui config role add` without `--workspace` now default to
127
140
  the Home-internal `managedGlobalRoleWorkspace(home)` (`<home>/workspaces/global`),
128
141
  and `setup` no longer fabricates an external Home-sibling `workspace/` — a
129
142
  `default-workspace` is persisted only if the user configured one. A user who
@@ -28,6 +28,17 @@ Yui 只有一个权威产品 Store:WAL 模式下的 `YUI_HOME/yui.db`。`schem
28
28
  不完整的或损坏的 Home 一律 fail closed。不存在运行时归一化、修复 worker、
29
29
  文件 Store 回退、双读写路径或第二套迁移权威。
30
30
 
31
+ 类型化领域记录在写入、普通读取、有界 Context 分页和全 Home 检查时,共用一份
32
+ 现行校验注册表。直接 Store 与 worker-backed Store 不存在不同强度的校验。
33
+ 无效写入不会推进 revision;已存在的无效记录只会报错并保留供明确诊断,
34
+ 不会被自动规范化成看似有效的替代记录。
35
+
36
+ 存储 35 新增仅由迁移写入的 `storage_migration_archive`:
37
+ `migration_version / family / record_key / payload / content`。它保留退休的
38
+ Project/gate 原始 payload 和二进制日志,不在当前模型中解释这些历史格式,
39
+ 也不是调度状态、第二份缓存或运行时回退。Task 内的历史 Integration 使用普通
40
+ Task 事件保存。数据库备份同时保留当前记录与这份审计存档。
41
+
31
42
  ## 写入与并发合同
32
43
 
33
44
  - 每次修改是一个 SQLite 事务。
@@ -54,8 +65,8 @@ WorkItem 与 Task 的验收权威仍归 Leader。
54
65
 
55
66
  每次持久 schema 或负载变更都追加一条不可变、连续的存储迁移。CLI 同时发布
56
67
  `storageVersion` 与 `minimumStorageVersion`;处在该闭区间内的每个有效 Home 都能
57
- 直接升级到当前版本,无需安装中间发行版。当前源码在
58
- `src/storage/storageVersions.ts` 中声明存储版本 **18**、最低支持迁移版本 **1**。
68
+ 直接升级到当前版本,无需安装中间发行版。当前版本及最低支持版本统一由
69
+ `src/storage/storageVersions.ts` 声明,并由 CLI 身份读取暴露。
59
70
  低于该下限的 Home 不是迁移输入,保持原样不动。目标二进制的
60
71
  `upgrade --update-preflight` 与 `--update-apply` 结果形态,以及由父进程持有的
61
72
  交接锁证明,对从存储版本 1 起发布的每个 updater 都保持向后兼容,因此一个旧的
@@ -61,10 +61,10 @@ it does not accept a WorkItem or rewrite dependencies.
61
61
  Direct and replicated execution share one Leader acceptance boundary. A
62
62
  replicated Producer does not form a Candidate; only the explicitly synthesized
63
63
  main Run result enters the candidate path. Delivery the Leader manages directly
64
- must also satisfy the applicable Candidate, ChangeSet and Integration boundaries.
64
+ must also satisfy the applicable Candidate and Integration boundaries.
65
65
 
66
- An isolated code result captures a fixed per-Project ChangeSet and integrates via
67
- compare-and-swap after its checks; an uncaptured, unintegrated or stale latest
66
+ An isolated code result freezes per-Project Candidate commits and integrates via
67
+ compare-and-swap after its checks; an unsnapshotted, unintegrated or stale latest
68
68
  result cannot satisfy delivery. Review is checked against the applicable rule and
69
69
  the Task contract. A Task main the Leader delivers itself needs a clean,
70
70
  committed, exact snapshot.
@@ -45,9 +45,9 @@ InputRequest 表示待决问题;回答不自动接受 WorkItem 或改写依赖
45
45
 
46
46
  Direct 和 replicated 共享一个 Leader 接受边界。Replicated Producer 不形成
47
47
  Candidate;只有显式综合的 main Run 结果进入候选路径。Leader 直接管理的
48
- 交付也必须满足适用的 Candidate、ChangeSet 和 Integration 边界。
48
+ 交付也必须满足适用的 Candidate 和 Integration 边界。
49
49
 
50
- 隔离代码结果按 Project 捕获固定 ChangeSet,检查后 CAS 集成;未捕获、未集成
50
+ 隔离代码结果按 Project 冻结 Candidate 提交,检查后 CAS 集成;缺少快照、未集成
51
51
  或失效的最新结果不能满足交付。Review 依适用规则和 Task 合同检查。
52
52
  Leader 自己交付的 Task main 需要干净、已提交的精确快照。
53
53