@zq-silk/yui 0.13.9 → 0.14.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.
- package/ARCHITECTURE.md +69 -428
- package/README.md +108 -298
- package/dist/agent/managedRuntimeEnvironment.js +2 -2
- package/dist/cli/commandCatalog.js +39 -77
- package/dist/cli/interactionCandidates.js +4 -4
- package/dist/cli/interactionPolicy.js +7 -10
- package/dist/cli/invocationRouter.js +1 -1
- package/dist/cli/updateCommand.js +6 -27
- package/dist/cli/updateOrchestrator.js +63 -484
- package/dist/cli/updatePorts.js +15 -333
- package/dist/cli/upgradeCommand.js +8 -65
- package/dist/cli.js +57 -242
- package/dist/commands/configCommands.js +11 -62
- package/dist/commands/executionAuditCommands.js +23 -23
- package/dist/commands/globalRoleCommands.js +2 -7
- package/dist/commands/jobCommands.js +1 -4
- package/dist/commands/projectCommands.js +5 -5
- package/dist/commands/releaseCommands.js +3 -10
- package/dist/commands/resourcesCommands.js +2 -2
- package/dist/commands/sessionCommands.js +2 -2
- package/dist/commands/taskActor.js +31 -39
- package/dist/commands/taskChangeSetCommands.js +5 -12
- package/dist/commands/taskCommands.js +464 -1249
- package/dist/commands/taskContextCommand.js +35 -36
- package/dist/commands/taskExecutionCommands.js +33 -46
- package/dist/commands/taskInputCommands.js +20 -42
- package/dist/commands/taskNextActionCommand.js +9 -9
- package/dist/commands/taskOverviewCommand.js +56 -95
- package/dist/commands/taskRoleRuntimeStatus.js +77 -107
- package/dist/commands/taskUpstreamCommands.js +3 -3
- package/dist/commands/taskWorkspaceCommands.js +7 -79
- package/dist/commands/telemetryCommands.js +32 -124
- package/dist/commands/workflowCommands.js +3 -3
- package/dist/completion/fileCompletionManager.js +1 -1
- package/dist/config/configCatalog.js +4 -6
- package/dist/config/yuiConfig.js +6 -43
- package/dist/context/dispatchContext.js +14 -30
- package/dist/context/roleSessionContext.js +2 -2
- package/dist/context/sessionBootstrapManifest.js +2 -2
- package/dist/context/{runContextPack.js → turnContextPack.js} +58 -73
- package/dist/context/turnInputContract.js +204 -0
- package/dist/context/wakeNotification.js +2 -2
- package/dist/controller/agentRuntimeObserver.js +18 -18
- package/dist/controller/clientRuntime.js +13 -20
- package/dist/controller/controller.js +89 -116
- package/dist/controller/fileSchedulerStoreAdapter.js +511 -742
- package/dist/controller/jobControl.js +17 -17
- package/dist/controller/resourceInventory.js +6 -6
- package/dist/controller/resourceInventoryLinux.js +38 -59
- package/dist/controller/resourceInventoryRpc.js +3 -3
- package/dist/controller/resourceInventoryWorker.js +1 -1
- package/dist/controller/runtime.js +46 -53
- package/dist/controller/runtimeEventInbox.js +23 -31
- package/dist/controller/runtimeEventProcessor.js +15 -15
- package/dist/controller/{runtimeHookRunFence.js → runtimeHookTurnFence.js} +87 -81
- package/dist/controller/runtimeLaunchCoordinator.js +3 -3
- package/dist/controller/runtimeObservationHook.js +11 -8
- package/dist/controller/sessionNotify.js +11 -11
- package/dist/controller/structuredProviderObservation.js +89 -16
- package/dist/coordination/workMailbox.js +309 -579
- package/dist/coordination/workMailboxQueue.js +5 -6
- package/dist/core/controllerClient.js +1 -91
- package/dist/core/controllerServer.js +3 -6
- package/dist/doctor/doctor.js +51 -314
- package/dist/execution/candidateConvergence.js +3 -3
- package/dist/execution/executionGroup.js +32 -33
- package/dist/execution/executionHealth.js +36 -38
- package/dist/execution/resourceBroker.js +12 -12
- package/dist/executor/agentExecutor.js +30 -265
- package/dist/executor/effectiveLaunch.js +9 -19
- package/dist/executor/executorRegistry.js +43 -17
- package/dist/executor/fileRoleLaunchPlanner.js +56 -56
- package/dist/executor/launchPlan.js +3 -3
- package/dist/executor/workspacePreflightClassification.js +16 -16
- package/dist/grant/capabilityGrant.js +20 -25
- package/dist/input/inputRequest.js +12 -12
- package/dist/integration/changeSet.js +9 -13
- package/dist/integration/changeSetManifest.js +1 -1
- package/dist/integration/gitIntegrationService.js +2 -2
- package/dist/integration/integrationQueueService.js +5 -21
- package/dist/integration/overlapDiagnostics.js +2 -2
- package/dist/interaction/operatorPresentation.js +1 -1
- package/dist/job/jobRunner.js +1 -1
- package/dist/lifecycle/canonicalLifecycleEvent.js +25 -25
- package/dist/lifecycle/{exactRunTerminalization.js → exactTurnTerminalization.js} +116 -232
- package/dist/message/message.js +6 -6
- package/dist/observability/executionAudit.js +74 -86
- package/dist/observability/faultClassification.js +7 -24
- package/dist/observability/orchestrationMetrics.js +5 -5
- package/dist/observability/runtimeIdentity.js +34 -101
- package/dist/profile/agentProfile.js +1 -1
- package/dist/release/cliHomeReleaseFence.js +3 -3
- package/dist/release/releaseWorkflowEngine.js +6 -10
- package/dist/release/releaseWorkflowPorts.js +2 -2
- package/dist/release/workflowFileLock.js +1 -1
- package/dist/repository/checkoutSwap.js +1 -1
- package/dist/repository/gitWorkspace.js +0 -13
- package/dist/repository/project.js +1 -1
- package/dist/repository/projectMaintenanceLock.js +1 -2
- package/dist/repository/taskBaseFreshness.js +13 -13
- package/dist/repository/taskWorkspaceCoordinator.js +21 -25
- package/dist/repository/taskWorkspaceIdentity.js +8 -21
- package/dist/repository/taskWorkspacePreparer.js +63 -620
- package/dist/resources/autoResourceGc.js +3 -3
- package/dist/resources/liveReferences.js +1 -1
- package/dist/resources/resourceGc.js +1 -1
- package/dist/resources/sqliteResourceRegistry.js +1 -1
- package/dist/review/reviewDecision.js +7 -7
- package/dist/review/reviewFindingLedger.js +1 -1
- package/dist/review/reviewOutcomeClassifier.js +35 -50
- package/dist/review/reviewRound.js +14 -25
- package/dist/review/reviewerAvailability.js +4 -4
- package/dist/review/taskFinalReviewContractResolution.js +41 -0
- package/dist/role/role.js +6 -3
- package/dist/runtime/agentDriver.js +4 -0
- package/dist/runtime/agentHost.js +151 -36
- package/dist/runtime/builtinAgentDrivers.js +79 -2
- package/dist/runtime/codexAppServerRuntime.js +122 -0
- package/dist/runtime/continuationManager.js +3 -5
- package/dist/runtime/exactControlPlane.js +17 -42
- package/dist/runtime/firstProgressAdvisory.js +1 -1
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/launchDiagnostics.js +2 -2
- package/dist/runtime/lifecycleReservation.js +4 -4
- package/dist/runtime/processExitObservation.js +1 -1
- package/dist/runtime/processExitOutbox.js +0 -32
- package/dist/runtime/promptEnvelope.js +9 -9
- package/dist/runtime/providerContinuation.js +2 -2
- package/dist/runtime/providerContinuationReconciliationService.js +2 -2
- package/dist/runtime/providerRuntimeIdentity.js +76 -24
- package/dist/runtime/recentTurnIds.js +38 -0
- package/dist/runtime/runtimeContinuationProjection.js +2 -2
- package/dist/runtime/runtimeHealthPolicy.js +1 -1
- package/dist/runtime/runtimeObservation.js +58 -21
- package/dist/runtime/runtimeProjection.js +19 -27
- package/dist/runtime/sessionLaunchRequest.js +2 -2
- package/dist/runtime/structuredProviderHost.js +177 -12
- package/dist/runtime/tmuxAdapters.js +46 -11
- package/dist/scheduler/activeRoleTurnDelivery.js +245 -0
- package/dist/scheduler/leaderWakeupProcessor.js +147 -445
- package/dist/scheduler/operatorEvent.js +4 -6
- package/dist/scheduler/resourceQueueProjection.js +71 -0
- package/dist/scheduler/{roleRunLiveness.js → roleTurnLiveness.js} +24 -28
- package/dist/scheduler/{roleRunStall.js → roleTurnStall.js} +162 -247
- package/dist/scheduler/taskExecutionProjection.js +99 -99
- package/dist/scheduler/taskObservabilityProjection.js +10 -10
- package/dist/scheduler/taskWake.js +4 -4
- package/dist/scheduler/wakeReason.js +6 -10
- package/dist/scheduler/wakeupQueue.js +0 -9
- package/dist/setup/setupCommand.js +2 -2
- package/dist/storage/currentTaskStore.js +46 -0
- package/dist/storage/persistenceWorker.js +1 -1
- package/dist/storage/sqliteSchema.js +81 -485
- package/dist/storage/sqliteStore.js +206 -365
- package/dist/storage/storageSchema.js +1 -15
- package/dist/storage/storageVersions.js +8 -9
- package/dist/storage/storeRpc.js +10 -34
- package/dist/storage/taskStore.js +63 -3415
- package/dist/storage/upgrade/recordVersions.js +55 -149
- package/dist/storage/upgrade/upgradeOrchestrator.js +89 -1752
- package/dist/task/completionReadiness.js +5 -5
- package/dist/task/deliveryGuard.js +10 -10
- package/dist/task/nextAction.js +74 -77
- package/dist/task/task.js +2 -4
- package/dist/task/taskRecordReference.js +3 -3
- package/dist/task/taskRecordRetirement.js +1 -1
- package/dist/telemetry/sqliteTelemetryStore.js +53 -53
- package/dist/telemetry/telemetryConfig.js +14 -14
- package/dist/telemetry/telemetryWiring.js +8 -14
- package/dist/turn/turn.js +356 -0
- package/dist/{run/runIdentity.js → turn/turnIdentity.js} +4 -4
- package/dist/verification/gateArtifactStore.js +2 -2
- package/dist/web/assets/client/app.js +1 -1
- package/dist/web/assets/client/components.js +29 -54
- package/dist/web/assets/client/i18n.js +17 -37
- package/dist/web/assets/client/view.js +37 -37
- package/dist/web/assets/shell.js +1 -1
- package/dist/web/assets/styles/cards.js +5 -5
- package/dist/web/assets/styles/widgets.js +1 -2
- package/dist/web/webSnapshot.js +65 -60
- package/dist/workItem/workItem.js +11 -11
- package/dist/workspace/workItemChangeSetManager.js +1 -1
- package/docs/task-local-identity.md +5 -5
- package/i18n/README.zh-CN.md +41 -54
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +85 -83
- package/skills/yui-operator/SKILL.md +16 -16
- package/skills/yui-reviewer/SKILL.md +10 -10
- package/skills/yui-runtime/SKILL.md +17 -18
- package/skills/yui-worker/SKILL.md +16 -18
- package/dist/context/runContextContract.js +0 -162
- package/dist/executor/turnCompletion.js +0 -126
- package/dist/review/taskFinalReviewContractEvent.js +0 -1
- package/dist/review/taskFinalReviewContractRebind.js +0 -367
- package/dist/run/agentRun.js +0 -356
- package/dist/run/rejectedYieldAttempt.js +0 -221
- package/dist/run/runControlRequest.js +0 -50
- package/dist/run/yieldReceipt.js +0 -65
- package/dist/runtime/turnCompletion.js +0 -3
- package/dist/scheduler/actionability.js +0 -323
- package/dist/scheduler/activeRoleRunDelivery.js +0 -868
- package/dist/scheduler/activeTaskProgress.js +0 -126
- package/dist/storage/compatibleTaskStore.js +0 -248
- package/dist/storage/migration/baseline.js +0 -78
- package/dist/storage/migration/classifier.js +0 -51
- package/dist/storage/migration/compatibleCodec.js +0 -53
- package/dist/storage/migration/engine.js +0 -147
- package/dist/storage/migration/index.js +0 -33
- package/dist/storage/migration/planner.js +0 -154
- package/dist/storage/migration/productionRegistry.js +0 -3931
- package/dist/storage/migration/registry.js +0 -169
- package/dist/storage/migration/report.js +0 -54
- package/dist/storage/migration/types.js +0 -31
- package/dist/storage/upgrade/homeClassification.js +0 -353
- package/dist/storage/upgrade/homeMigrationTarget.js +0 -595
- package/dist/storage/upgrade/migrationReceipt.js +0 -67
- package/dist/storage/upgrade/offlineUpgradeInventory.js +0 -453
- package/dist/storage/upgrade/productionMigrationRegistry.js +0 -6
- package/dist/storage/upgrade/pseudoLayoutRepair.js +0 -241
- package/dist/storage/upgrade/recordVersionScan.js +0 -176
- package/dist/storage/upgrade/sqliteFileSet.js +0 -50
- package/dist/storage/upgrade/sqliteMigrationTarget.js +0 -375
- package/dist/storage/upgrade/sqliteRecordMigrationTarget.js +0 -305
- package/dist/storage/upgrade/sqliteStateMigration.js +0 -918
- package/dist/storage/upgrade/switchProgress.js +0 -80
- package/dist/storage/upgrade/upgradeReceipt.js +0 -161
- package/dist/storage/upgradeCoordination.js +0 -187
- package/dist/storage/upgradeFence.js +0 -366
- package/dist/telemetry/telemetryCompaction.js +0 -252
package/README.md
CHANGED
|
@@ -72,11 +72,16 @@ export YUI_HOME=/absolute/path/to/yui-home
|
|
|
72
72
|
yui setup
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
The home contains `schema.json`, the authoritative `
|
|
75
|
+
The home contains `schema.json`, the authoritative SQLite database `yui.db`,
|
|
76
|
+
Project Catalog and knowledge, and Controller discovery files. Stable Project
|
|
77
|
+
checkouts and managed worktrees live under the configured workspace, outside
|
|
78
|
+
Yui home. Runtime storage accepts only the exact current contract; it never
|
|
79
|
+
falls back to `state.json`, normalizes an older shape, or repairs a historical
|
|
80
|
+
Home in place.
|
|
76
81
|
|
|
77
82
|
Every Task-owned record family allocates a monotonically increasing local ID
|
|
78
83
|
inside its Task. Different Tasks may therefore both contain `work-item-1`,
|
|
79
|
-
`
|
|
84
|
+
`turn-1`, or `input-1`. A managed Task session may use that short local ID
|
|
80
85
|
because `YUI_TASK_ID` supplies the scope. Outside a Task session, use the
|
|
81
86
|
qualified form `<task-id>/<local-id>`; Yui never searches every Task for a bare
|
|
82
87
|
ID. Commands that already take a Task explicitly, such as `task work create`
|
|
@@ -84,160 +89,27 @@ and `task integration start`, keep their subordinate IDs local to that Task.
|
|
|
84
89
|
Candidate IDs are local to their WorkItem and carry both Task and WorkItem
|
|
85
90
|
provenance.
|
|
86
91
|
|
|
87
|
-
Yui
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
durable per-family source of truth and raw `state.json` is structurally
|
|
109
|
-
cross-checked against it before the strict current loader. A target family that
|
|
110
|
-
the persisted manifest does not yet name is explicit version `0`; it is usable
|
|
111
|
-
only through a declared record-family `0->1` introduction. Absence of records in
|
|
112
|
-
`state.json` never promotes that family to current by itself.
|
|
113
|
-
`yui doctor`, staged `yui update` preflight, and `yui upgrade` therefore share
|
|
114
|
-
four product states:
|
|
115
|
-
|
|
116
|
-
- **current** (`USABLE`) — every axis is current.
|
|
117
|
-
- **compatible-old** (`COMPATIBLE`) — every older hop is an explicitly declared
|
|
118
|
-
record-only normalization; ordinary commands load the current domain model and
|
|
119
|
-
the first write emits current records plus the matching current manifest only.
|
|
120
|
-
- **migration-required** (`MIGRATABLE`) — at least one declared offline hop has
|
|
121
|
-
a complete deterministic step path.
|
|
122
|
-
- **unsupported** (`NEEDS_NEW_VERSION` or `CORRUPTED`) — a future version,
|
|
123
|
-
missing declaration/step, invalid old shape, or real structural/reference
|
|
124
|
-
damage. The result names the incompatible component and reason.
|
|
125
|
-
|
|
126
|
-
`yui update` stages and pins the new package side by side, then lets that exact
|
|
127
|
-
artifact run an internal path-specific read-only preflight against the target
|
|
128
|
-
Home: classification for current, strict compatible-source/current-model
|
|
129
|
-
validation for compatible-old, and classification plus authoritative offline
|
|
130
|
-
inventory for migration-required. This is deliberately distinct from user-facing
|
|
131
|
-
`upgrade --dry-run`: it creates no migration target or staged Home and claims no
|
|
132
|
-
staged-output validation, so it remains usable while the exact old Controller is
|
|
133
|
-
running. Current and compatible-old Homes
|
|
134
|
-
take the fast path: Yui captures and stops the exact old Controller, promotes the
|
|
135
|
-
same staged artifact, authenticates and starts the replacement Controller, and
|
|
136
|
-
post-verifies through the compatible loader. It does not copy, back up, rename,
|
|
137
|
-
or replay the Home and does not wait for Provider Sessions. Existing managed
|
|
138
|
-
Task Sessions keep their frozen exact executable/CLI path, Home, control digest,
|
|
139
|
-
Task/Run/launch/native-Session fence; replacement never retargets them through
|
|
140
|
-
PATH. At that managed continuity gate, package-version drift alone is accepted
|
|
141
|
-
because the same path now runs the activated CLI, while protocol, layout,
|
|
142
|
-
aggregate, path, Home, digest, and runtime-identity drift still fail closed. The
|
|
143
|
-
existing Session can therefore record progress and yield through the replacement
|
|
144
|
-
Controller without weakening the offline path's zero-Session requirement.
|
|
145
|
-
The first successful new write is the downgrade boundary because it is current-only.
|
|
146
|
-
|
|
147
|
-
Migration-required Homes take the offline path. Before binary activation,
|
|
148
|
-
Controller stop, admission fence, staging, or Home mutation, Yui re-reads an
|
|
149
|
-
authoritative inventory and blocks on active or in-flight Runs, live or unknown
|
|
150
|
-
native Sessions, pending turn completion, lifecycle mailboxes, or durable inbox
|
|
151
|
-
events. Stopped/history-only Sessions, a Role with no native process, and an open
|
|
152
|
-
Input by itself do not block. A blocker reports the total and exact available
|
|
153
|
-
Task/Role/Run/native-session/launch identities and reason, leaves the scene
|
|
154
|
-
unchanged, and tells the user to re-run `yui update` after the listed work clears;
|
|
155
|
-
it never kills, resets, rebinds, retries, or drains on the user's behalf.
|
|
156
|
-
After every listed Turn or Run finishes, the user can stop all idle managed
|
|
157
|
-
Sessions from a normal shell and retry the update:
|
|
158
|
-
|
|
159
|
-
```sh
|
|
160
|
-
yui session stop --all
|
|
161
|
-
yui update
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
`session stop --all` first checks every current Session and refuses without
|
|
165
|
-
stopping anything while any Session still has a running Turn/Run or pending
|
|
166
|
-
lifecycle work. Once clear, it fences new Leader dispatch, stops and drains the
|
|
167
|
-
Controller, rechecks the runtime facts, then stops every exact idle Session. The
|
|
168
|
-
Controller remains stopped so `yui update` can enter its offline window. When the
|
|
169
|
-
installed version predates this command, exit every listed managed Session
|
|
170
|
-
manually instead; a staged new CLI cannot write the older migration-required Home.
|
|
171
|
-
|
|
172
|
-
Only that user re-run may enter the existing full migration. Once its preflight
|
|
173
|
-
is clear, the update parent captures and stops the exact old Controller PID. The
|
|
174
|
-
staged activation then runs the full migration: it places an admission fence (new
|
|
175
|
-
writers, CLI and Controller alike, refuse to start), waits for any writer already
|
|
176
|
-
admitted through `.state.lock`, and rechecks the offline inventory before staging,
|
|
177
|
-
validation, and switch. It then enters one shared sibling coordination boundary.
|
|
178
|
-
Inside it, both the runtime-lifecycle mailboxes AND the durable runtime inbox (`runtime/inbox/*`) are
|
|
179
|
-
checked (either non-empty blocks at `drain-incomplete`, so authoritative
|
|
180
|
-
not-yet-applied events are never dropped by a switch), followed by the revision
|
|
181
|
-
pin, complete-home copy, validation, and two-step switch.
|
|
182
|
-
The boundary is `<home>.upgrade-coordination.lock`, outside the Home so renames
|
|
183
|
-
cannot move a live lock. Inbox `publish` takes that same lock, checks the fence
|
|
184
|
-
and any unresolved switch-progress marker while holding it, writes the temp/link/
|
|
185
|
-
fsync event, and releases it. Upgrade takes the lock after the Controller drain,
|
|
186
|
-
proves both runtime lanes, re-pins the revision under `.state.lock`, copies the
|
|
187
|
-
complete Home, and keeps the coordination lock through `home -> backup` and
|
|
188
|
-
`staging -> home`. Thus a hook admitted before the fence either finishes before
|
|
189
|
-
the final snapshot (and its event is copied) or waits and receives an explicit
|
|
190
|
-
`UpgradeFenceError` after cutover; it can safely re-deliver and is never silently
|
|
191
|
-
stranded only in the backup. With no fence, the normal hook path keeps the same
|
|
192
|
-
durable behavior, only serialized at this boundary. **Fence acquisition is a
|
|
193
|
-
single atomic file create**, so two concurrent upgraders never both acquire —
|
|
194
|
-
exactly one wins and the other fails closed. A provably-dead owner's stale fence
|
|
195
|
-
is reclaimed, but the reclaim is an **atomic compare-and-delete** (it removes only
|
|
196
|
-
the exact stale bytes, under a lock), so a fresh live fence a racer created in the
|
|
197
|
-
meantime is never clobbered — two entrants can never both end up "acquired". That
|
|
198
|
-
reclaim lock is itself **crash-recoverable** (owner-pid + age reclaim), so a
|
|
199
|
-
holder that crashes mid-reclaim cannot orphan it and permanently block admission;
|
|
200
|
-
when a reclaim cannot be proven complete the writer fails closed rather than
|
|
201
|
-
falsely reporting the home writable. The coordination lock uses the same bounded
|
|
202
|
-
crash-recovery rule: it records an owner PID, waits only for a bounded interval,
|
|
203
|
-
and atomically renames aside a lock whose owner is provably dead (or whose
|
|
204
|
-
owner-less directory is older than the conservative acquisition window). A live
|
|
205
|
-
or undeterminable holder fails closed, so a crash cannot deadlock the Home and a
|
|
206
|
-
live writer is never evicted by a TTL. A switch-progress marker blocks hook
|
|
207
|
-
admission when the Home is missing or uninitialized (including a malformed
|
|
208
|
-
marker, because its recovery phase is unknowable); a stale marker beside an
|
|
209
|
-
intact Home is ignored just as the update probe ignores it after corroborating
|
|
210
|
-
the filesystem. The lock order is one-way — coordination
|
|
211
|
-
lock, then `.state.lock`; inbox writers never acquire `.state.lock` — so no
|
|
212
|
-
coordination cycle is introduced. An **uninitialized home** (never `yui setup`)
|
|
213
|
-
returns a structured "run `yui setup`" blocker rather than a silent no-op. Quiesce
|
|
214
|
-
**fails closed on any undeterminable signal**: a `.state.lock` that exists but
|
|
215
|
-
whose owner is missing/empty/non-integer/unreadable (a writer may be
|
|
216
|
-
mid-acquisition), or a malformed `runtime/controller.json`, is treated as an
|
|
217
|
-
active runtime and blocks the upgrade; only a provably-absent lock or a
|
|
218
|
-
clearly-dead owner is safe to proceed past.
|
|
219
|
-
|
|
220
|
-
The migration only transforms `schema.json` + `state.json`, but because the
|
|
221
|
-
atomic switch replaces the whole home directory, **staging carries a complete
|
|
222
|
-
copy of the home** — `runtime/`, `runtime/inbox/*` (authoritative), `cache/`, and
|
|
223
|
-
`artifacts/` are all preserved through the switch and retained in the backup, with
|
|
224
|
-
no silent loss (the transient `.state.lock` is the sole exception; a real home
|
|
225
|
-
entry that happens to share the staging directory's name is preserved too, and an
|
|
226
|
-
in-home staging layout is refused outright). The switch is two renames with one
|
|
227
|
-
non-atomic window, and **every** step after the first rename — the fsyncs and the
|
|
228
|
-
progress-marker writes, not just the rename — is phase-aware: a failure first
|
|
229
|
-
attempts an automatic rollback, and only if that rollback **also** fails is the
|
|
230
|
-
home reported as partially switched (a distinct `switch-ambiguous` blocker with
|
|
231
|
-
the exact `mv "<backup>" "<home>"` recovery) — it never falsely claims the home is
|
|
232
|
-
unchanged. A crash mid-switch leaves a durable marker; `yui update` recovery reads
|
|
233
|
-
that marker plus filesystem evidence (backup present, home missing) to name the
|
|
234
|
-
exact backup restore rather than a generic retry. Any other failed or blocked step
|
|
235
|
-
leaves the authoritative home byte-for-byte unchanged and reports the exact
|
|
236
|
-
blocker stage and recovery action. Only explicitly registered adjacent steps
|
|
237
|
-
can convert a real home; Yui never dual-reads an older schema or guesses an old
|
|
238
|
-
identifier. Compatible loading remains an explicit normalization contract, not
|
|
239
|
-
a permissive old-schema reader. See
|
|
240
|
-
[Task-local identity](docs/task-local-identity.md) for the current reference
|
|
92
|
+
Yui records layout, aggregate, and per-record-family versions in `schema.json`,
|
|
93
|
+
but runtime admission has only two outcomes: exact current, or rejected. A
|
|
94
|
+
missing, older, newer, or malformed contract is never converted by the running
|
|
95
|
+
release. `yui doctor` and `yui upgrade [--dry-run]` are read-only diagnostics;
|
|
96
|
+
`yui upgrade` does not stage, repair, back up, or switch a Home.
|
|
97
|
+
|
|
98
|
+
`yui update` stages and pins one exact package, runs that staged binary's
|
|
99
|
+
current-contract preflight, stops the exact old Controller, activates the same
|
|
100
|
+
artifact, verifies the installed binary and current Home, and starts the
|
|
101
|
+
replacement Controller. Storage is not copied or migrated. If the staged
|
|
102
|
+
release cannot open the Home exactly, the update stops before activation and
|
|
103
|
+
leaves both the Home and current installation unchanged.
|
|
104
|
+
|
|
105
|
+
To retain an old Home, keep it byte-for-byte and open it only with its original
|
|
106
|
+
Yui version for read-only inspection. For unfinished work, initialize a new
|
|
107
|
+
Home and let the Operator create a new Task from the old Task's objective,
|
|
108
|
+
relevant WorkItems, current repository state, and available result summaries.
|
|
109
|
+
The Operator creates new identities; it does not import old runtime/session
|
|
110
|
+
state or pretend that the old Task continued.
|
|
111
|
+
|
|
112
|
+
See [Task-local identity](docs/task-local-identity.md) for the current reference
|
|
241
113
|
contract.
|
|
242
114
|
|
|
243
115
|
Schema work across Tasks is not serialized: any Task may advance a version axis
|
|
@@ -340,7 +212,7 @@ before the swap leaves only a removable staging clone).
|
|
|
340
212
|
|
|
341
213
|
`project retire` is the auditable soft deprecation: it records who retired the Project, when, and
|
|
342
214
|
why, while retaining the catalog record, checkout, and every historical
|
|
343
|
-
Task/
|
|
215
|
+
Task/Turn/Review/Integration/Publication reference. A retired Project cannot be refreshed,
|
|
344
216
|
updated, migrated, reset, replaced, maintained through Knowledge writes (add/retire/propose/
|
|
345
217
|
accept/reject), or bound to new Tasks, WorkItems, or Integrations; Knowledge reads (`list`,
|
|
346
218
|
`show`, `proposals list/show`) stay open so the evidence stays auditable.
|
|
@@ -352,7 +224,7 @@ then moves the checkout to a tombstone before removing the catalog record, resto
|
|
|
352
224
|
failure so the catalog and checkout never disagree unrecoverably. `project show` and
|
|
353
225
|
`project list` display the lifecycle status and retirement record.
|
|
354
226
|
|
|
355
|
-
Use `task context` as the first detailed read of an existing Task. It combines the Task, Brief, active Decisions, recent Milestones, Roles, current and recent WorkItems with their
|
|
227
|
+
Use `task context` as the first detailed read of an existing Task. It combines the Task, Brief, active Decisions, recent Milestones, Roles, current and recent WorkItems with their Turns, recent Messages, open and resolved InputRequests, and recent Events. Terminal output keeps histories and long text compact; `yui --json task context <task-id>` returns the complete records in the top-level `data` field.
|
|
356
228
|
|
|
357
229
|
Leader wakeups stay deliberately small: the wake envelope carries only the
|
|
358
230
|
aggregated wake reasons, a delta window, and read pointers. The durable wake
|
|
@@ -364,8 +236,8 @@ yui task wake show <task-id> <wake-id>
|
|
|
364
236
|
```
|
|
365
237
|
|
|
366
238
|
`wake list` shows the dispatch history with status, reasons, and consuming
|
|
367
|
-
|
|
368
|
-
|
|
239
|
+
Turn; `wake show` renders one wake's delta window — the Events, Messages, and
|
|
240
|
+
Turns recorded between its cursors. A human or Agent can still force a wake
|
|
369
241
|
with `yui task wake <task-id> --force --reason "<text>"`.
|
|
370
242
|
|
|
371
243
|
Human-facing timestamps default to Beijing time (`Asia/Shanghai`) while durable
|
|
@@ -398,7 +270,7 @@ Every result entering Leader acceptance is one explicit candidate on its
|
|
|
398
270
|
existing WorkItem. The current global rule applies to the next candidate in
|
|
399
271
|
every existing or new Task; that candidate snapshots the rule, so later
|
|
400
272
|
`set`/`clear` changes do not rewrite an in-flight decision.
|
|
401
|
-
`always` starts a ReviewRound for every candidate, including a
|
|
273
|
+
`always` starts a ReviewRound for every candidate, including a completed Role Turn
|
|
402
274
|
or a Leader-managed direct result; `leader` leaves the candidate awaiting
|
|
403
275
|
acceptance so the Leader can accept it directly or run
|
|
404
276
|
`yui task work review <task-id>/<work-item-id>`. A configured review rule therefore keeps
|
|
@@ -409,12 +281,12 @@ contract requires one. The Round snapshots the exact Task-main Project heads
|
|
|
409
281
|
directly, so even a Leader-owned Task with no WorkItem can be reviewed without
|
|
410
282
|
locking the mutable Task workspace. A changed frozen head needs a new semantic
|
|
411
283
|
Round; the same Reviewer Session continues in its
|
|
412
|
-
stable workspace, while every
|
|
284
|
+
stable workspace, while every Turn remains bound to its exact Round and head.
|
|
413
285
|
The Reviewer follows Project Policy/Knowledge and reports reachable, material,
|
|
414
286
|
actionable findings across the complete Task.
|
|
415
287
|
A ReviewRound freezes the Candidate's exact Git commit and updates the
|
|
416
288
|
Reviewer Role's stable writable workspace to that head while recording exact
|
|
417
|
-
Round-owned workspace evidence. Its
|
|
289
|
+
Round-owned workspace evidence. Its Turn may edit,
|
|
418
290
|
test, and optionally commit diagnostic evidence there, but never changes the
|
|
419
291
|
Candidate or Worker workspace and never creates another WorkItem, Candidate,
|
|
420
292
|
ChangeSet, or recursive review. The result wakes the Leader, who decides whether
|
|
@@ -423,7 +295,7 @@ Worker in its existing Session, review again, or request user input.
|
|
|
423
295
|
A failed review remains visible evidence and wakes the Leader, but does not
|
|
424
296
|
take that decision away from the Leader.
|
|
425
297
|
Task context and next-action expose direct Review facts: every frozen Project
|
|
426
|
-
commit, its relation to the current candidate, the active
|
|
298
|
+
commit, its relation to the current candidate, the active Turn, and the Reviewer
|
|
427
299
|
workspace. A request that fails after Round creation retains the ReviewRound
|
|
428
300
|
and reports its exact reason; the Leader opens that Round and decides whether
|
|
429
301
|
to retry, inspect or clean the workspace, use another Reviewer, or continue
|
|
@@ -442,8 +314,8 @@ Yui Core supplies lifecycle and exact-scope safety; generic role Skills supply
|
|
|
442
314
|
portable collaboration behavior; Project Policy/Knowledge supplies
|
|
443
315
|
project-specific build, test, migration, release, and review rules; the Task
|
|
444
316
|
Contract supplies the current objective and acceptance. Project-backed Workers
|
|
445
|
-
commit and leave the Develop workspace clean before
|
|
446
|
-
|
|
317
|
+
commit and leave the Develop workspace clean before ending the Provider Turn.
|
|
318
|
+
Yui stores the final Turn result and freezes each writable Project's HEAD in the Candidate
|
|
447
319
|
snapshot; ReviewRound worktrees are recreated from those exact commits even if
|
|
448
320
|
Develop later advances during repair.
|
|
449
321
|
|
|
@@ -515,7 +387,7 @@ The delivery chain is `isolate -> Candidate -> ReviewRound -> ChangeSet capture
|
|
|
515
387
|
Candidate commit and never become a Develop ChangeSet source.
|
|
516
388
|
|
|
517
389
|
Write scope may only expand. The Leader supplies the complete old-plus-new set
|
|
518
|
-
after a Worker
|
|
390
|
+
after a Worker reports that another repository is required; an
|
|
519
391
|
existing writable Project cannot be removed:
|
|
520
392
|
|
|
521
393
|
```sh
|
|
@@ -566,7 +438,7 @@ yui task execution stop <task-id> --force --reason "<why execution must be fence
|
|
|
566
438
|
yui task execution start <task-id>
|
|
567
439
|
```
|
|
568
440
|
|
|
569
|
-
`stop` terminates disposable
|
|
441
|
+
`stop` terminates disposable Turns and Sessions while preserving WorkItems,
|
|
570
442
|
repository changes, Messages, reviews, and other Task progress. `start` admits
|
|
571
443
|
one new Leader attempt from those durable records; it does not recover an old
|
|
572
444
|
Agent conversation.
|
|
@@ -666,50 +538,39 @@ set. Codex options are `sandbox` and `approval`; Claude options are `mode`,
|
|
|
666
538
|
`allowedTools`, and `disallowedTools`. Provider permission is independent from
|
|
667
539
|
Profile behavior and Project write authority: only an exact WorkItem scope and
|
|
668
540
|
matching managed workspace grant normal Project writes. A ReviewRound is the only non-WorkItem write
|
|
669
|
-
purpose and must match its
|
|
541
|
+
purpose and must match its Turn, reviewRoundId, frozen base, and
|
|
670
542
|
ReviewRound-owned workspace; every mismatch fails closed. Its diagnostic commit
|
|
671
543
|
is visible history but is
|
|
672
544
|
explicitly rejected by capture, ChangeSet, Integration, and acceptance paths.
|
|
673
|
-
|
|
674
|
-
|
|
545
|
+
The Reviewer's final Provider response is its complete free-form Markdown or
|
|
546
|
+
JSON report. If a JSON report
|
|
675
547
|
includes known `checks` or `evidenceCommit` fields, Yui records them as
|
|
676
548
|
structured evidence and verifies the reported commit against the managed
|
|
677
549
|
Review branch HEAD; unknown fields remain part of the report. Dirty uncommitted
|
|
678
|
-
diagnosis may
|
|
550
|
+
diagnosis may end without a commit; the worktree is retained and cleanup
|
|
679
551
|
refuses it until it is clean.
|
|
680
552
|
|
|
681
553
|
Every Role desired launch change increments its revision and applies only to a
|
|
682
|
-
future launch. Each
|
|
554
|
+
future launch. Each Turn and native Role Session stores the complete actual
|
|
683
555
|
agent, adapter, model, effort, Profile access intent, exact writable Projects,
|
|
684
556
|
permission strategy and native options, workspace, context, and source desired revision. Updating,
|
|
685
557
|
switching, or clearing Role overrides never
|
|
686
|
-
hot-mutates an existing process. `task context`, Role views,
|
|
558
|
+
hot-mutates an existing process. `task context`, Role views, Turn history,
|
|
687
559
|
Events, and Web show desired/effective revisions, Profile intent, permission, and
|
|
688
560
|
pending next-launch drift.
|
|
689
561
|
|
|
690
|
-
Both Codex and Claude deliver a managed
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
```sh
|
|
697
|
-
yui task run yield <task-id>/<run-id> --summary-file - <<'YUI_SUMMARY'
|
|
698
|
-
Implemented the exporter; focused tests pass
|
|
699
|
-
YUI_SUMMARY
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
Yield completes the AgentRun, submits the WorkItem for Leader review, appends
|
|
703
|
-
the result message, and queues the Leader. It does not accept the WorkItem. A
|
|
704
|
-
Leader never wakes itself; any pending Operator or Worker wake remains durable
|
|
705
|
-
until the Leader is idle.
|
|
562
|
+
Both Codex and Claude deliver a managed Turn through the Provider's native Turn
|
|
563
|
+
terminal. Yui stores the final assistant response as the exact Turn result,
|
|
564
|
+
submits the WorkItem for Leader review, and queues the Leader. It does not
|
|
565
|
+
accept the WorkItem. A Leader never wakes itself; any pending Operator or Worker
|
|
566
|
+
wake remains durable until the Leader is idle.
|
|
706
567
|
|
|
707
568
|
If the outcome cannot be determined, label the handoff `uncertain`,
|
|
708
569
|
`incomplete`, `blocked`, or `requiring Leader judgment` and submit the most
|
|
709
570
|
complete truthful identities, actions, repository state, checks and errors,
|
|
710
571
|
lifecycle boundary, unfinished work, open decisions, risks, confidence, and
|
|
711
|
-
bounded next options.
|
|
712
|
-
|
|
572
|
+
bounded next options. The Turn result is immutable execution evidence only; it
|
|
573
|
+
does not imply acceptance, WorkItem completion, ChangeSet capture,
|
|
713
574
|
Integration, or Task completion.
|
|
714
575
|
|
|
715
576
|
For one substantial feature requirement, the Leader may create a WorkItem and
|
|
@@ -742,10 +603,10 @@ yui task work update <task-id>/<work-item-id> done \
|
|
|
742
603
|
Use `inherited` or `unknown` when the native runtime does not expose an actual
|
|
743
604
|
model or effort; do not guess. The three supported paths remain deliberately
|
|
744
605
|
small: Leader direct execution, a conversation-native subagent, or a Task Role
|
|
745
|
-
|
|
606
|
+
Turn when work needs its own provider, credentials, interaction, or durable
|
|
746
607
|
Session.
|
|
747
608
|
|
|
748
|
-
For an isolated Task Role result, the Leader first reviews the
|
|
609
|
+
For an isolated Task Role result, the Leader first reviews the stored Turn result.
|
|
749
610
|
An insufficient result is rejected with feedback and redispatched in the same
|
|
750
611
|
workspace. An acceptable result is captured and integrated in a candidate
|
|
751
612
|
worktree. Checks run there, and the target advances only if its recorded HEAD
|
|
@@ -768,7 +629,7 @@ yui task integration resolve <task-id>/<integration-id> \
|
|
|
768
629
|
yui task integration continue <task-id>/<integration-id>
|
|
769
630
|
```
|
|
770
631
|
|
|
771
|
-
Worker
|
|
632
|
+
Worker Turn completion is not WorkItem completion. The Leader accepts only after reviewing
|
|
772
633
|
the result, validations, and the latest ChangeSet integration:
|
|
773
634
|
|
|
774
635
|
```sh
|
|
@@ -785,25 +646,25 @@ operational projections without deleting their audit records:
|
|
|
785
646
|
|
|
786
647
|
```sh
|
|
787
648
|
yui task message retire <task>/<message> --reason "Superseded instruction"
|
|
788
|
-
yui task
|
|
649
|
+
yui task turn retire <task>/<turn> --reason "Invalid launch record"
|
|
789
650
|
```
|
|
790
651
|
|
|
791
652
|
These commands append a retirement fact. Lists and audit views retain the
|
|
792
|
-
original Message, WorkItem, or
|
|
653
|
+
original Message, WorkItem, or Turn and mark it retired; managed Turn context,
|
|
793
654
|
actionability, recovery, review evidence, and scheduling ignore it. Retiring
|
|
794
|
-
an active
|
|
795
|
-
idempotent. Only the user or global Operator may retire Messages or
|
|
655
|
+
an active Turn first terminalizes that exact Turn, and retirement is
|
|
656
|
+
idempotent. Only the user or global Operator may retire Messages or Turns;
|
|
796
657
|
WorkItems may also be retired by their Task Leader.
|
|
797
658
|
|
|
798
659
|
For long-running Tasks, the Leader keeps Yui—not a native transcript—as the
|
|
799
660
|
recovery authority. The Task Brief owns the overall technical approach,
|
|
800
661
|
including how coordinated Project changes fit together. WorkItems own the
|
|
801
662
|
executable per-Project modifications and acceptance checks. The Leader updates
|
|
802
|
-
Brief focus and Leader summary before
|
|
663
|
+
Brief focus and Leader summary before ending each Provider Turn, records material choices as
|
|
803
664
|
Decisions, adds phase outcomes as Milestones, and promotes only cross-Task
|
|
804
665
|
stable facts to Project Knowledge.
|
|
805
666
|
|
|
806
|
-
When an active Leader
|
|
667
|
+
When an active Leader Turn cannot continue without a user decision, it creates a durable InputRequest and ends its Provider Turn with a truthful blocked result:
|
|
807
668
|
|
|
808
669
|
```sh
|
|
809
670
|
yui task input request <task-id> --question "Which format should be the default?" \
|
|
@@ -831,7 +692,7 @@ Inspect the result:
|
|
|
831
692
|
yui task context <task-id>
|
|
832
693
|
```
|
|
833
694
|
|
|
834
|
-
Use the narrower `task work`, `task message`, `task
|
|
695
|
+
Use the narrower `task work`, `task message`, `task turn`, and Task Knowledge commands when you need one collection or record.
|
|
835
696
|
|
|
836
697
|
When the requested outcome is finished, complete the Task to stop automatic Leader wakes without deleting its sessions or Task main worktree:
|
|
837
698
|
|
|
@@ -866,7 +727,7 @@ audit records the authorization and, on completion, the accepted Project,
|
|
|
866
727
|
Publication, optional ReviewRound, both commits, and tree.
|
|
867
728
|
|
|
868
729
|
Completed Tasks reject messages, dispatch, Provider authority changes, retry,
|
|
869
|
-
and late
|
|
730
|
+
and late Turn delivery until explicitly reopened, while retaining Task main for
|
|
870
731
|
inspection or integration. Terminal WorkItem, Review, Integration, and Lane
|
|
871
732
|
worktrees are non-blocking completion advisories, but they must be settled
|
|
872
733
|
before archive. Every isolated WorkItem worktree is explicitly cleaned as
|
|
@@ -891,7 +752,7 @@ Yui's Agent Host and proxy while leaving the daemon and thread untouched; start
|
|
|
891
752
|
creates a fresh proxy attachment.
|
|
892
753
|
If the proxy disconnects, the Host may attach a bounded replacement client and
|
|
893
754
|
reconcile the exact owned Turn from native history. A failed fresh attachment
|
|
894
|
-
is released instead of becoming a cleanup prerequisite for later
|
|
755
|
+
is released instead of becoming a cleanup prerequisite for later Turns.
|
|
895
756
|
Claude Code keeps its independent stream-json process. Agent Host is the sole
|
|
896
757
|
writer to that process, so a completed stream write accepts the Turn; the
|
|
897
758
|
later provider `result` event settles it. An uncertain write becomes
|
|
@@ -908,16 +769,17 @@ yui task role release <task-id> <role>
|
|
|
908
769
|
For an independently hosted Provider such as Claude, these commands are the
|
|
909
770
|
supported human-control boundary. A Codex Role uses an ordinary shared thread
|
|
910
771
|
and may be operated directly in Desktop; an active Desktop Turn creates bounded
|
|
911
|
-
backpressure for Yui rather than a failed
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
carry a second current-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
772
|
+
backpressure for Yui rather than a failed Turn.
|
|
773
|
+
|
|
774
|
+
Turn is the only durable Role scheduling state. Conversation state does not
|
|
775
|
+
carry a second current-Turn pointer. A Yui-dispatched Provider Turn carries the
|
|
776
|
+
durable Turn id that correlates its visible input and terminal result; a direct
|
|
777
|
+
Provider Turn is recorded as direct conversation history without entering the
|
|
778
|
+
scheduling pointer. A native Turn terminal completes that Turn, after which Yui
|
|
779
|
+
may claim the next Turn and submit it through the same Session.
|
|
780
|
+
TaskRole itself stores identity and desired launch configuration, not runtime
|
|
781
|
+
status; Role status shown by CLI/Web is derived from the active Turn plus
|
|
782
|
+
Session/Driver lifecycle facts.
|
|
921
783
|
|
|
922
784
|
Global Operator and global Role sessions remain native interactive CLIs:
|
|
923
785
|
|
|
@@ -925,12 +787,10 @@ Global Operator and global Role sessions remain native interactive CLIs:
|
|
|
925
787
|
yui session enter <global-role>
|
|
926
788
|
```
|
|
927
789
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
when any Role is still busy. On success it also leaves the Controller stopped;
|
|
933
|
-
run `yui update` next rather than resuming ordinary Task work.
|
|
790
|
+
`yui update` accepts only the current Home contract and never migrates storage.
|
|
791
|
+
For an older Home, keep its Sessions stopped, inspect it with the original Yui
|
|
792
|
+
version, and let the current Operator recreate unfinished intent as new Tasks in
|
|
793
|
+
a newly initialized Home. Runtime ids and mailbox state are not copied.
|
|
934
794
|
|
|
935
795
|
tmux fixes a pane's history capacity when that pane is created. Existing panes
|
|
936
796
|
retain their configured capacity; managed runtime output remains observable in
|
|
@@ -948,20 +808,20 @@ cross-Agent switch, the saved model and effort are reused unless the user
|
|
|
948
808
|
explicitly chooses to update them.
|
|
949
809
|
|
|
950
810
|
The Role's active binding is desired state for the next compatible launch. A
|
|
951
|
-
running
|
|
811
|
+
running Turn and its native Session continue under their immutable
|
|
952
812
|
effective snapshot even if the Role is edited or switched. Resume is allowed
|
|
953
813
|
only when the complete effective snapshot and workspace remain compatible;
|
|
954
814
|
otherwise Yui starts a new Session after the old process has stopped and keeps
|
|
955
815
|
the terminal Session's immutable effective snapshot in history. Managed
|
|
956
816
|
Sessions invoke the ordinary `yui` command; their Manifest and durable
|
|
957
|
-
Role/
|
|
817
|
+
Role/Turn fences authenticate scope while protocol and storage compatibility
|
|
958
818
|
allow a CLI package or Controller upgrade in place. Exact internal callbacks
|
|
959
819
|
remain fenced to their originating runtime snapshot.
|
|
960
820
|
|
|
961
821
|
Use `yui config role unbind <global-role> <agent-id>` or `yui task role unbind <task-id> <role> <agent-id>` to retire a dormant binding. The active binding and any non-stopped native session are rejected; a stopped session record is removed atomically with the binding.
|
|
962
822
|
|
|
963
823
|
Claude session IDs are preallocated at launch. Codex discovers its native
|
|
964
|
-
thread identity from App Server responses. Managed Task
|
|
824
|
+
thread identity from App Server responses. Managed Task Turns use structured
|
|
965
825
|
Provider observations for both CLIs. Global interactive Codex sessions may
|
|
966
826
|
still use its `notify` callback for conversation presentation.
|
|
967
827
|
|
|
@@ -972,7 +832,7 @@ parses prompt glyphs, progress text, trust dialogs, or other Agent terminal
|
|
|
972
832
|
output to infer readiness or success. `captureRole()` remains an explicit
|
|
973
833
|
human-facing transcript read and has no lifecycle authority.
|
|
974
834
|
|
|
975
|
-
The [
|
|
835
|
+
The [AgentRuntime Driver architecture](docs/agent-runtime-drivers.md) keeps
|
|
976
836
|
native Codex/Claude event names at the edge. Core consumes exact-fenced
|
|
977
837
|
Session, Turn, operation, waiting, host, and activity observations. A positive
|
|
978
838
|
token delta is evidence of recent runtime activity; an unchanged counter is
|
|
@@ -980,9 +840,9 @@ not. A live tmux pane proves only that the host exists. Runtime activity and
|
|
|
980
840
|
durable workflow progress use independent clocks, so token/tool/resource
|
|
981
841
|
movement cannot conceal a workflow that is not advancing.
|
|
982
842
|
|
|
983
|
-
Stable Role context never creates a separate bootstrap Turn. Task execution
|
|
843
|
+
Stable Role context never creates a separate bootstrap Turn. Task execution Turns use the generic Leader or Worker Skill, while review Turns use the generic Reviewer Skill based on durable Turn purpose rather than a configured Role name. The provider either carries the Skill through a safe additive native context channel or points to it from the ordinary Task delivery. These Yui-owned Role Skills define portable orchestration only. Project Skills remain ordinary versioned files in the Project and are discovered, selected, and loaded by the Agent through its native project mechanism; Yui does not scan, parse, copy, or inject them.
|
|
984
844
|
|
|
985
|
-
Managed Codex keeps the user's native developer instructions unchanged. The ordinary Task message includes a compact absolute Session Manifest pointer, and the manifest identifies the matching Yui-owned Role Skill for Codex to read on demand. Model, effort, permission, workspace, and shell settings are supplied to `thread/start` or `thread/resume` through the shared App Server daemon; a Codex native config profile is rejected because it cannot be isolated to one shared-daemon thread. The underlying Codex config file is never mutated. App Server notifications are the managed thread's lifecycle authority; Yui installs no managed Codex Hook and does not claim `notify`. Interactive Codex Sessions may still use Yui's structured `notify` callback, and Doctor reports any effective configuration conflict. `skills.config` is not misused because it only enables or disables already-discovered Skills. Claude receives the same Yui-owned Role Skill content from a private `0600` managed context file rather than a large or sensitive argv value; retries and resumes reuse the purpose-specific Role path. Non-Operator global Roles stay neutral and receive no Task orchestration Skill. Operator therefore opens at an empty native composer, so the user's text remains its first user message. Leader wakeups and Worker or Reviewer
|
|
845
|
+
Managed Codex keeps the user's native developer instructions unchanged. The ordinary Task message includes a compact absolute Session Manifest pointer, and the manifest identifies the matching Yui-owned Role Skill for Codex to read on demand. Model, effort, permission, workspace, and shell settings are supplied to `thread/start` or `thread/resume` through the shared App Server daemon; a Codex native config profile is rejected because it cannot be isolated to one shared-daemon thread. The underlying Codex config file is never mutated. App Server notifications are the managed thread's lifecycle authority; Yui installs no managed Codex Hook and does not claim `notify`. Interactive Codex Sessions may still use Yui's structured `notify` callback, and Doctor reports any effective configuration conflict. `skills.config` is not misused because it only enables or disables already-discovered Skills. Claude receives the same Yui-owned Role Skill content from a private `0600` managed context file rather than a large or sensitive argv value; retries and resumes reuse the purpose-specific Role path. Non-Operator global Roles stay neutral and receive no Task orchestration Skill. Operator therefore opens at an empty native composer, so the user's text remains its first user message. Leader wakeups and Worker or Reviewer Turn assignments remain real mailbox-delivered work messages.
|
|
986
846
|
|
|
987
847
|
## Controller and failure handling
|
|
988
848
|
|
|
@@ -1018,31 +878,31 @@ Read-only commands and `upgrade --dry-run` do not start a Controller. `update`
|
|
|
1018
878
|
also replaces an already-running Controller only after the new binary passes its
|
|
1019
879
|
health checks.
|
|
1020
880
|
|
|
1021
|
-
Its recovery reconciliation runs every 120 seconds by default. Normal durable state changes enqueue a Task, Role, or Operator key and return immediately; keys received in the same fixed 100 ms window trigger one non-overlapping targeted pass. Operator presentation has an independent lane, so a blocked Task workspace operation cannot delay a user question. Periodic Git/worktree work is limited to Tasks with durable Task-mailbox work, while active Role liveness uses one tmux inventory. Structured Agent Driver observations, whether received from native provider events or supported Hooks, are exact-fenced before they reach the durable runtime inbox. A terminal Turn observation
|
|
881
|
+
Its recovery reconciliation runs every 120 seconds by default. Normal durable state changes enqueue a Task, Role, or Operator key and return immediately; keys received in the same fixed 100 ms window trigger one non-overlapping targeted pass. Operator presentation has an independent lane, so a blocked Task workspace operation cannot delay a user question. Periodic Git/worktree work is limited to Tasks with durable Task-mailbox work, while active Role liveness uses one tmux inventory. Structured Agent Driver observations, whether received from native provider events or supported Hooks, are exact-fenced before they reach the durable runtime inbox. A terminal Turn observation atomically records the exact Turn result. Durable mailboxes freeze the current batch while new signals merge into the next batch. Task-orchestration failures retain the exact Controller-owned processing batch for two bounded fast retries and later periodic recovery; a successful retry completes that batch before newer pending work is claimed. Recommended InputRequest and pending Turn deadlines share one nearest-deadline selector and therefore do not wait for the recovery interval. Explicit `task reconcile` still requests an immediate recovery pass. The retained loop is:
|
|
1022
882
|
|
|
1023
883
|
1. dispatch pending Leader wakes whose Task workspaces are already ready;
|
|
1024
884
|
2. prepare active Project Task main worktrees with durable orchestration work;
|
|
1025
|
-
3. deliver queued Worker
|
|
885
|
+
3. deliver queued Worker Turns;
|
|
1026
886
|
4. resolve due Turn completions and reconcile Role liveness;
|
|
1027
887
|
5. dispatch Leader work created or unblocked by the later recovery phases.
|
|
1028
888
|
|
|
1029
|
-
Automated input is sent only through tmux. Each pass performs one non-blocking process-state readiness check; a busy startup is retried through a small bounded mailbox timer, while later busy sessions are woken by canonical Agent Driver terminal observations. A pane-local receipt prevents the same
|
|
889
|
+
Automated input is sent only through tmux. Each pass performs one non-blocking process-state readiness check; a busy startup is retried through a small bounded mailbox timer, while later busy sessions are woken by canonical Agent Driver terminal observations. A pane-local receipt prevents the same Turn input from being typed twice after a Controller retry.
|
|
1030
890
|
|
|
1031
|
-
If a Role process exits
|
|
891
|
+
If a Role process exits without a terminal Provider result, the Controller fails that Turn and running WorkItem and queues the Leader. Recovery failures are exposed through the small Jobs view:
|
|
1032
892
|
|
|
1033
893
|
```sh
|
|
1034
894
|
yui jobs list
|
|
1035
895
|
yui jobs retry leader-recovery:<task-id>
|
|
1036
896
|
yui task reconcile <task-id>
|
|
1037
|
-
yui task
|
|
1038
|
-
yui task
|
|
897
|
+
yui task turn retry <failed-turn-id>
|
|
898
|
+
yui task turn settle <obsolete-failed-review-turn-id>
|
|
1039
899
|
```
|
|
1040
900
|
|
|
1041
901
|
`jobs` is not a restored generic queue: it presents durable pending Leader wakes and Leader recovery failures only.
|
|
1042
902
|
|
|
1043
|
-
`task
|
|
903
|
+
`task turn settle` is a Leader-only repair for one exact failed Reviewer Turn whose
|
|
1044
904
|
matching Task-final ReviewRound was stranded running by an older lifecycle. It
|
|
1045
|
-
closes only an obsolete frozen candidate, preserves the
|
|
905
|
+
closes only an obsolete frozen candidate, preserves the Turn, Round, workspace,
|
|
1046
906
|
and evidence, and never creates a retry Round.
|
|
1047
907
|
|
|
1048
908
|
Completion is the reversible execution fence. Archiving is terminal and is accepted only after active work is settled: it stops the Task's tmux session and removes clean managed worktrees. Dirty worktrees keep the Task completed and are preserved for deliberate resolution.
|
|
@@ -1058,7 +918,7 @@ yui web
|
|
|
1058
918
|
|
|
1059
919
|
Use `--port <port>` or `--host 127.0.0.1|::1|localhost` to change the
|
|
1060
920
|
listener. Yui rejects non-loopback hosts because the control room exposes Task
|
|
1061
|
-
metadata, Briefs, Roles, WorkItems,
|
|
921
|
+
metadata, Briefs, Roles, WorkItems, Turns, messages, Decisions, Milestones, and
|
|
1062
922
|
InputRequests. A random token embedded in the served page protects its write
|
|
1063
923
|
and terminal endpoints.
|
|
1064
924
|
|
|
@@ -1076,12 +936,12 @@ question and urgency so you can answer without drilling in, and the list of
|
|
|
1076
936
|
currently active tasks. Each task row carries a derived execution status
|
|
1077
937
|
(progressing, needs attention, blocked, recovering) so stalled or failed
|
|
1078
938
|
work is visible before you open a task. Selecting a task opens an anchored
|
|
1079
|
-
detail view (Summary, Focus, Work items,
|
|
939
|
+
detail view (Summary, Focus, Work items, Turns, Roles, History, Messages)
|
|
1080
940
|
with a sticky tab bar that tracks the visible section. The Summary tab leads
|
|
1081
941
|
with an execution band that consolidates the Task's owner, current action,
|
|
1082
942
|
attention list, blockers, and fail-closed indicators; Work items surface
|
|
1083
943
|
their current ExecutionGroup with per-lane status, Candidates, and
|
|
1084
|
-
retirement disposition;
|
|
944
|
+
retirement disposition; Turns show purpose, execution lineage, final result,
|
|
1085
945
|
and Leader disposition.
|
|
1086
946
|
|
|
1087
947
|
The control room supports English and Simplified Chinese, selecting an initial locale from the browser and remembering manual changes. The theme selector switches between the dark Control Room, the light Paper Ledger, and the dark-blue Atlas themes. Both choices are stored only in browser `localStorage`; they do not modify `YUI_HOME`.
|
|
@@ -1103,63 +963,16 @@ yui project add|clone|refresh|update|discover|list|show|knowledge
|
|
|
1103
963
|
yui project reset|replace|retire|delete
|
|
1104
964
|
```
|
|
1105
965
|
|
|
1106
|
-
`yui update` stages the newly published package
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
Both paths run a new-binary health check before the authenticated Controller
|
|
1117
|
-
handoff. When an old Controller exists, it is stopped with an exact PID fence;
|
|
1118
|
-
when no old Controller existed, the same verified new Controller is started
|
|
1119
|
-
before the update reports success.
|
|
1120
|
-
Yui promotes the **same artifact it staged**
|
|
1121
|
-
(binary activation pins the exact staged version, never a second bare `@latest`);
|
|
1122
|
-
the staged version must be a **concrete semver** — a `latest`/dist-tag sentinel,
|
|
1123
|
-
a malformed value, or a probe without a valid `{ ok:true }` envelope at exit 0 is
|
|
1124
|
-
rejected and the stage **fails** rather than falling back to `@latest`. The health
|
|
1125
|
-
check runs the **actually-activated** global binary and **requires** its version
|
|
1126
|
-
to be concrete and equal to the staged one — a missing, unparseable, or mismatched
|
|
1127
|
-
version fails closed (never skipped). Every spawned-child result must be a valid
|
|
1128
|
-
`{ ok:true, data }` **success envelope** before its outcome is trusted (else
|
|
1129
|
-
preflight blocks / activation is ambiguous), and a success-class outcome is
|
|
1130
|
-
trusted **only when the process also exited 0**. The post-update health check
|
|
1131
|
-
**parses and validates the machine-readable `yui --json doctor` envelope before
|
|
1132
|
-
interpreting the exit status** — because `--json doctor` exits non-zero on
|
|
1133
|
-
unhealthy storage — requires **every** expected storage check present-and-`ok`
|
|
1134
|
-
(a missing/duplicated/malformed check fails closed), and rejects an unparseable or
|
|
1135
|
-
self-contradictory envelope; only a valid success envelope with all storage checks
|
|
1136
|
-
`ok` and exit 0 is healthy. On any failure it reports the exact phase and a
|
|
1137
|
-
recovery action.
|
|
1138
|
-
|
|
1139
|
-
On the offline path, if storage activation cannot be resolved — the spawned staged binary was
|
|
1140
|
-
killed or crashed after switching but before reporting — `yui update` reports a
|
|
1141
|
-
distinct **ambiguous** result (a dedicated non-zero exit), never a false
|
|
1142
|
-
"unchanged/recoverable". A durable completion receipt written the instant the
|
|
1143
|
-
switch commits (a `<home>.upgrade-receipt.json` sibling, cleared on clean
|
|
1144
|
-
success) lets it resolve the true state from receipt + backup + current schema
|
|
1145
|
-
and print precise manual-verification steps. The receipt is trusted only when it
|
|
1146
|
-
genuinely corresponds: it must carry this home's `homePath` and a `backupPath`
|
|
1147
|
-
that is the expected `<home>.backup-*` real directory, so a **legacy receipt
|
|
1148
|
-
without those fields, or one whose backup is unrelated / missing / not a
|
|
1149
|
-
directory** is not trusted as proof of this attempt's switch — the
|
|
1150
|
-
tool re-probes the real on-disk state instead.
|
|
1151
|
-
|
|
1152
|
-
Rollback boundary (precise): the managed Session launcher is an in-place
|
|
1153
|
-
forwarder, not a versioned package pointer, so Yui does **not** claim binary+Home
|
|
1154
|
-
dual-resource atomicity. It guarantees: (1) staging is isolated — a
|
|
1155
|
-
stage/preflight failure leaves the old binary and Home byte-for-byte unchanged;
|
|
1156
|
-
(2) the compatible fast path does not switch the Home; (3) the offline storage
|
|
1157
|
-
switch is atomic with a timestamped backup and is recoverable by restoring that
|
|
1158
|
-
backup until the new version resumes writes; (4) no auto-downgrade once the new
|
|
1159
|
-
version has written. The offline path's non-atomic window — storage already
|
|
1160
|
-
switched, binary promotion then fails — is reported with the exact
|
|
1161
|
-
`mv <backup> <home>` recovery, and because the axes are version-gated the old
|
|
1162
|
-
binary fail-closes on the new home rather than misreading it.
|
|
966
|
+
`yui update` stages the newly published package side by side and asks that exact
|
|
967
|
+
binary to verify that the Home already matches its current storage contract.
|
|
968
|
+
Only then does it stop the exact old Controller, activate the same concrete
|
|
969
|
+
package version, validate the actually installed binary and Home, and start the
|
|
970
|
+
replacement Controller. It never migrates or switches storage. An older or
|
|
971
|
+
otherwise unsupported Home blocks preflight and remains untouched.
|
|
972
|
+
|
|
973
|
+
`yui upgrade [--dry-run]` is retained as a read-only storage admission
|
|
974
|
+
diagnostic. It reports current, uninitialized, invalid, or unsupported state and
|
|
975
|
+
the Operator action; it never performs an upgrade.
|
|
1163
976
|
|
|
1164
977
|
Agent environment bindings store process-environment variable names, never secret values. Adapter-owned lifecycle arguments cannot be overridden through raw arguments.
|
|
1165
978
|
|
|
@@ -1169,10 +982,7 @@ Yui targets one trusted local user on one machine. Its Web/API surface is
|
|
|
1169
982
|
loopback-only and intentionally omits remote or multi-user Web access,
|
|
1170
983
|
distributed coordination, backup/import/export commands, trash/restore,
|
|
1171
984
|
derived indexes, recovery journals, runtime leases, inactivity TTLs,
|
|
1172
|
-
cooldowns, and recurring schedules.
|
|
1173
|
-
timestamped home backup `yui upgrade`/`yui update` takes immediately before an
|
|
1174
|
-
atomic storage switch, purely to make that single switch recoverable — it is not
|
|
1175
|
-
a general backup/restore facility.)
|
|
985
|
+
cooldowns, and recurring schedules.
|
|
1176
986
|
|
|
1177
987
|
See [ARCHITECTURE.md](./ARCHITECTURE.md) for persistence and scheduling details.
|
|
1178
988
|
## Development
|