@zq-silk/yui 0.14.0 → 0.14.2
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 +64 -35
- package/README.md +258 -125
- package/dist/agent/argumentPolicy.js +2 -1
- package/dist/agent/managedRuntimeEnvironment.js +5 -8
- package/dist/cli/commandCatalog.js +74 -109
- package/dist/cli/helpRenderer.js +1 -2
- package/dist/cli/interactionCandidates.js +10 -0
- package/dist/cli/interactionPolicy.js +76 -37
- package/dist/cli/roleWizard.js +5 -6
- package/dist/cli/updateOrchestrator.js +10 -8
- package/dist/cli/updatePorts.js +17 -13
- package/dist/cli/upgradeCommand.js +2 -5
- package/dist/cli.js +268 -231
- package/dist/commands/agentCommands.js +13 -0
- package/dist/commands/configCommands.js +7 -19
- package/dist/commands/configOverview.js +3 -2
- package/dist/commands/durableJobCommands.js +1 -1
- package/dist/commands/executionAuditCommands.js +4 -9
- package/dist/commands/globalRoleCommands.js +17 -0
- package/dist/commands/profileCommands.js +200 -30
- package/dist/commands/sessionCommands.js +1 -1
- package/dist/commands/taskActor.js +29 -127
- package/dist/commands/taskChangeSetCommands.js +1 -3
- package/dist/commands/taskCommands.js +1771 -2107
- package/dist/commands/taskCompletionGate.js +27 -103
- package/dist/commands/taskContextCommand.js +47 -80
- package/dist/commands/taskExecutionCommands.js +9 -27
- package/dist/commands/taskInputCommands.js +10 -10
- package/dist/commands/taskIntegrationCommands.js +69 -61
- package/dist/commands/taskIntegrationQueueCommands.js +1 -1
- package/dist/commands/taskNextActionCommand.js +8 -29
- package/dist/commands/taskOverviewCommand.js +25 -3
- package/dist/commands/taskPublicationCommands.js +151 -85
- package/dist/commands/taskPublicationVerifyCommand.js +181 -0
- package/dist/commands/taskRemoteDeliveryCommand.js +134 -0
- package/dist/commands/taskRoleRuntimeStatus.js +5 -6
- package/dist/commands/taskUpstreamCommands.js +79 -95
- package/dist/config/configCatalog.js +1 -1
- package/dist/context/contextSnapshot.js +17 -2
- package/dist/context/sessionBootstrapManifest.js +18 -1
- package/dist/context/sourceTurnContext.js +30 -0
- package/dist/context/turnContextPack.js +107 -48
- package/dist/context/turnInputContract.js +11 -4
- package/dist/context/wakeNotification.js +84 -22
- package/dist/controller/agentRuntimeObserver.js +9 -12
- package/dist/controller/clientRuntime.js +13 -13
- package/dist/controller/controller.js +11 -11
- package/dist/controller/fileSchedulerStoreAdapter.js +262 -219
- package/dist/controller/jobControl.js +11 -10
- package/dist/controller/resourceInventory.js +6 -6
- package/dist/controller/resourceInventoryLinux.js +2 -2
- package/dist/controller/runtime.js +18 -61
- package/dist/controller/runtimeEventInbox.js +57 -34
- package/dist/controller/runtimeEventProcessor.js +36 -96
- package/dist/controller/runtimeHookTurnFence.js +33 -57
- package/dist/controller/runtimeLaunchCoordinator.js +44 -40
- package/dist/controller/runtimeObservationHook.js +18 -12
- package/dist/controller/sessionNotify.js +43 -28
- package/dist/controller/sessionOwnerReconciliation.js +21 -21
- package/dist/controller/structuredProviderObservation.js +13 -16
- package/dist/coordination/workMailboxQueue.js +132 -0
- package/dist/core/controllerServer.js +1 -0
- package/dist/domain/agentResultTransport.js +60 -0
- package/dist/execution/executionHealth.js +111 -118
- package/dist/execution/reviewMainTurn.js +161 -0
- package/dist/execution/workItemExecution.js +454 -0
- package/dist/execution/workItemExecutionProjection.js +309 -0
- package/dist/execution/workItemMainTurn.js +164 -0
- package/dist/executor/agentExecutor.js +19 -19
- package/dist/executor/executorRegistry.js +7 -28
- package/dist/executor/fileRoleLaunchPlanner.js +51 -83
- package/dist/external/githubPublicationVerifier.js +114 -0
- package/dist/external/gitlabPublicationVerifier.js +158 -0
- package/dist/external/pinnedCommandRunner.js +73 -0
- package/dist/integration/changeSetManifest.js +0 -3
- package/dist/integration/deliveryObligation.js +43 -6
- package/dist/integration/gitIntegrationService.js +284 -101
- package/dist/integration/integrationAttempt.js +64 -14
- package/dist/integration/integrationQueueEntry.js +5 -35
- package/dist/integration/integrationQueueService.js +65 -194
- package/dist/lifecycle/canonicalLifecycleEvent.js +16 -15
- package/dist/lifecycle/exactTurnTerminalization.js +100 -97
- package/dist/message/message.js +16 -0
- package/dist/observability/executionAudit.js +4 -25
- package/dist/observability/faultClassification.js +58 -70
- package/dist/observability/orchestrationMetrics.js +8 -50
- package/dist/profile/agentProfile.js +60 -15
- package/dist/profile/agentProfileRuntime.js +100 -0
- package/dist/release/releaseWorkflowPorts.js +5 -68
- package/dist/repository/executionLaneGitSnapshot.js +80 -0
- package/dist/repository/gitWorkspace.js +9 -67
- package/dist/repository/taskBaseFreshness.js +3 -1
- package/dist/repository/taskWorkspaceCoordinator.js +32 -4
- package/dist/repository/taskWorkspacePreparer.js +252 -411
- package/dist/resources/liveReferences.js +6 -55
- package/dist/resources/resourceDiscovery.js +1 -30
- package/dist/resources/resourceRegistrar.js +0 -23
- package/dist/review/deltaRecheck.js +8 -65
- package/dist/review/reviewAcceptance.js +22 -19
- package/dist/review/reviewConfig.js +0 -10
- package/dist/review/reviewDecision.js +2 -2
- package/dist/review/reviewRound.js +147 -273
- package/dist/review/reviewerAvailability.js +13 -23
- package/dist/role/role.js +3 -0
- package/dist/runtime/agentDriverObservation.js +1 -1
- package/dist/runtime/agentHost.js +51 -51
- package/dist/runtime/builtinAgentDrivers.js +9 -2
- package/dist/runtime/codexAppServerRuntime.js +23 -5
- package/dist/runtime/exactControlPlane.js +2 -267
- package/dist/runtime/firstProgressAdvisory.js +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/launchBroker.js +11 -11
- package/dist/runtime/lifecycleReservation.js +2 -2
- package/dist/runtime/managedCaller.js +111 -0
- package/dist/runtime/ports.js +16 -3
- package/dist/runtime/preallocatedNativeSession.js +2 -2
- package/dist/runtime/processExitObservation.js +3 -2
- package/dist/runtime/providerContinuationReconciliationService.js +1 -1
- package/dist/runtime/runtimeBinding.js +1 -1
- package/dist/runtime/runtimeObservation.js +33 -16
- package/dist/runtime/runtimeSessionCandidate.js +2 -2
- package/dist/runtime/runtimeStopReceipt.js +11 -11
- package/dist/runtime/sessionLaunchRequest.js +2 -2
- package/dist/runtime/sessionOwnerIdentity.js +9 -9
- package/dist/runtime/sessionOwnerRegistry.js +13 -13
- package/dist/runtime/sessionReconciliation.js +4 -4
- package/dist/runtime/sessionTerminationGuard.js +9 -9
- package/dist/runtime/sessionTokenMetrics.js +5 -7
- package/dist/runtime/structuredProviderHost.js +5 -5
- package/dist/runtime/taskRuntimeIsolation.js +24 -24
- package/dist/runtime/tmuxAdapters.js +32 -30
- package/dist/scheduler/activeRoleTurnDelivery.js +37 -15
- package/dist/scheduler/leaderWakeupProcessor.js +78 -55
- package/dist/scheduler/roleTurnLiveness.js +6 -6
- package/dist/scheduler/roleTurnStall.js +8 -9
- package/dist/scheduler/taskExecutionProjection.js +19 -41
- package/dist/scheduler/taskObservabilityProjection.js +75 -122
- package/dist/storage/sqliteSchema.js +1 -21
- package/dist/storage/sqliteStore.js +62 -47
- package/dist/storage/storageSchema.js +1 -8
- package/dist/storage/storageVersions.js +7 -4
- package/dist/storage/taskStore.js +8 -8
- package/dist/storage/upgrade/upgradeOrchestrator.js +112 -83
- package/dist/task/completionReadiness.js +17 -98
- package/dist/task/deliveryGuard.js +9 -11
- package/dist/task/draftPlan.js +142 -0
- package/dist/task/nextAction.js +179 -477
- package/dist/task/publicationVerification.js +1 -0
- package/dist/task/remoteDelivery.js +233 -0
- package/dist/task/task.js +108 -4
- package/dist/task/taskRecordReference.js +0 -1
- package/dist/turn/turn.js +109 -16
- package/dist/verification/verificationGateService.js +0 -26
- package/dist/web/assets/client/components.js +99 -121
- package/dist/web/assets/client/i18n.js +136 -58
- package/dist/web/assets/client/view.js +44 -0
- package/dist/web/assets/styles/cards.js +3 -15
- package/dist/web/assets/styles/widgets.js +4 -0
- package/dist/web/webSnapshot.js +29 -14
- package/dist/workItem/dependencyGate.js +34 -0
- package/dist/workItem/workItem.js +99 -266
- package/dist/workspace/workItemChangeSetManager.js +15 -59
- package/docs/task-local-identity.md +1 -1
- package/i18n/README.zh-CN.md +165 -59
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +272 -782
- package/skills/yui-operator/SKILL.md +190 -365
- package/skills/yui-reviewer/SKILL.md +40 -33
- package/skills/yui-runtime/SKILL.md +27 -6
- package/skills/yui-worker/SKILL.md +19 -6
- package/dist/execution/candidateConvergence.js +0 -623
- package/dist/execution/executionGroup.js +0 -854
- package/dist/execution/resourceBroker.js +0 -426
- package/dist/executor/launchPlan.js +0 -16
- package/dist/review/reviewFinding.js +0 -240
- package/dist/review/reviewFindingLedger.js +0 -550
- package/dist/review/reviewOutcomeClassifier.js +0 -255
- package/dist/scheduler/resourceQueueProjection.js +0 -71
- package/dist/task/repairWave.js +0 -150
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Side-by-side `yui update` orchestration for the current storage contract.
|
|
3
3
|
*
|
|
4
|
-
* The staged binary
|
|
5
|
-
*
|
|
6
|
-
* repairs storage. An older Home stays untouched so an Operator can inspect it
|
|
7
|
-
* with its original Yui version and create a new current Task explicitly.
|
|
4
|
+
* The staged binary proves an exact-current Home before the exact Controller
|
|
5
|
+
* is stopped and the replacement is activated, verified, and restarted.
|
|
8
6
|
*/
|
|
9
7
|
export function runUpdate(ports, options) {
|
|
10
8
|
let staged;
|
|
@@ -105,14 +103,15 @@ function activateAndVerify(ports, staged, home, lifecycle) {
|
|
|
105
103
|
ports.verify(staged, home);
|
|
106
104
|
}
|
|
107
105
|
catch (error) {
|
|
108
|
-
|
|
106
|
+
const failure = {
|
|
109
107
|
outcome: "aborted",
|
|
110
108
|
phase: "post-verify",
|
|
111
109
|
message: `Post-update health check failed: ${messageOf(error)}`,
|
|
112
110
|
action: binaryHealthUncertainAction(),
|
|
113
111
|
recoverable: false,
|
|
114
112
|
version: staged.version
|
|
115
|
-
}
|
|
113
|
+
};
|
|
114
|
+
return restoreControllerOrReport(ports, home, lifecycle, failure);
|
|
116
115
|
}
|
|
117
116
|
if (lifecycle.ensureRunning) {
|
|
118
117
|
try {
|
|
@@ -140,7 +139,10 @@ function activateAndVerify(ports, staged, home, lifecycle) {
|
|
|
140
139
|
: restoreControllerOrReport(ports, home, lifecycle, failure);
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
|
-
return {
|
|
142
|
+
return {
|
|
143
|
+
outcome: "updated",
|
|
144
|
+
version: staged.version
|
|
145
|
+
};
|
|
144
146
|
}
|
|
145
147
|
function captureControllerLifecycle(ports, version, home) {
|
|
146
148
|
const supplied = [
|
|
@@ -186,7 +188,7 @@ function captureControllerLifecycle(ports, version, home) {
|
|
|
186
188
|
return { lifecycle: { ensureRunning: true, wasRunning: false } };
|
|
187
189
|
}
|
|
188
190
|
if (!isPositivePid(status.pid) || !isControllerIdentity(status.identity)) {
|
|
189
|
-
return malformedControllerResult(version, "The running Controller did not expose an exact PID and
|
|
191
|
+
return malformedControllerResult(version, "The running Controller did not expose an exact PID and runtime generation identity.");
|
|
190
192
|
}
|
|
191
193
|
let stopped;
|
|
192
194
|
try {
|
package/dist/cli/updatePorts.js
CHANGED
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* `npm install --global --prefix <tmp>`, so the live global install is never
|
|
8
8
|
* touched until the binary-activation step. Preflight invokes the STAGED binary's
|
|
9
9
|
* internal `yui upgrade --update-preflight` contract so the target version
|
|
10
|
-
* proves that the Home
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* activated global binary.
|
|
10
|
+
* proves that the Home exactly matches its current storage contract. After the
|
|
11
|
+
* parent stops the exact old Controller, the binary is promoted and the
|
|
12
|
+
* activated binary verifies the unchanged Home.
|
|
14
13
|
*
|
|
15
14
|
* Two hardening guarantees this module enforces:
|
|
16
15
|
*
|
|
@@ -514,6 +513,9 @@ function runControllerCommand(home, environment, spawn, method, cliBinary) {
|
|
|
514
513
|
env: {
|
|
515
514
|
...environment,
|
|
516
515
|
YUI_HOME: home,
|
|
516
|
+
// Lifecycle capture needs the schema-independent resource inventory,
|
|
517
|
+
// not the optional current-schema identity health verdict.
|
|
518
|
+
YUI_STATUS_IDENTITY: "0",
|
|
517
519
|
// This exact lifecycle child is part of the update process that owns
|
|
518
520
|
// the handover lock. Managed Sessions never receive this bypass.
|
|
519
521
|
YUI_UPDATE_HANDOVER_OWNER_PID: String(process.pid)
|
|
@@ -693,7 +695,7 @@ function assertActivatedControllerIdentity(identity, activatedBinary, activatedV
|
|
|
693
695
|
if (identity.executablePath !== process.execPath
|
|
694
696
|
|| identity.args.length !== 1
|
|
695
697
|
|| identity.args[0] !== expectedEntrypoint) {
|
|
696
|
-
throw new Error("Replacement Controller
|
|
698
|
+
throw new Error("Replacement Controller runtime generation identity does not match the activated global binary "
|
|
697
699
|
+ "runtime/entrypoint; refusing readiness.");
|
|
698
700
|
}
|
|
699
701
|
}
|
|
@@ -782,19 +784,21 @@ function interpretPreflight(result) {
|
|
|
782
784
|
...(data.sceneUnchanged === true ? { sceneUnchanged: true } : {})
|
|
783
785
|
};
|
|
784
786
|
}
|
|
785
|
-
/**
|
|
787
|
+
/** Accept only an exact current Home. */
|
|
786
788
|
function parseUpdatePreflightResult(data) {
|
|
787
|
-
if (data.status !== "already-current"
|
|
789
|
+
if (data.status !== "already-current"
|
|
790
|
+
|| !Number.isSafeInteger(data.stepCount)
|
|
791
|
+
|| data.stepCount !== 0
|
|
792
|
+
|| !Array.isArray(data.steps)
|
|
793
|
+
|| data.steps.length !== 0)
|
|
788
794
|
return null;
|
|
789
795
|
const homeClassification = data.classification;
|
|
790
796
|
if (!isRecord(homeClassification) || !isRecord(homeClassification.classification))
|
|
791
797
|
return null;
|
|
792
798
|
const classification = homeClassification.classification;
|
|
793
|
-
if (classification.verdict !== "USABLE"
|
|
794
|
-
|| classification.status !== "current") {
|
|
799
|
+
if (classification.verdict !== "USABLE" || classification.status !== "current")
|
|
795
800
|
return null;
|
|
796
|
-
}
|
|
797
|
-
return { status: "already-current" };
|
|
801
|
+
return { status: "already-current", stepCount: 0 };
|
|
798
802
|
}
|
|
799
803
|
function parseUpdateBlockers(value) {
|
|
800
804
|
if (value === undefined)
|
|
@@ -806,7 +810,7 @@ function parseUpdateBlockers(value) {
|
|
|
806
810
|
if (!isRecord(item) || typeof item.reason !== "string" || item.reason.length === 0) {
|
|
807
811
|
return undefined;
|
|
808
812
|
}
|
|
809
|
-
const optional = ["taskId", "roleName", "turnId", "nativeSessionId", "
|
|
813
|
+
const optional = ["taskId", "roleName", "turnId", "nativeSessionId", "runtimeGenerationId"];
|
|
810
814
|
if (optional.some((key) => item[key] !== undefined && typeof item[key] !== "string")) {
|
|
811
815
|
return undefined;
|
|
812
816
|
}
|
|
@@ -817,7 +821,7 @@ function parseUpdateBlockers(value) {
|
|
|
817
821
|
...(typeof item.nativeSessionId === "string"
|
|
818
822
|
? { nativeSessionId: item.nativeSessionId }
|
|
819
823
|
: {}),
|
|
820
|
-
...(typeof item.
|
|
824
|
+
...(typeof item.runtimeGenerationId === "string" ? { runtimeGenerationId: item.runtimeGenerationId } : {}),
|
|
821
825
|
reason: item.reason
|
|
822
826
|
});
|
|
823
827
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `yui upgrade` is now a read-only storage admission diagnostic. This release
|
|
3
|
-
* opens only its exact current contract and never rewrites an historical Home.
|
|
4
|
-
*/
|
|
1
|
+
/** `yui upgrade` validates the exact storage contract supported by this release. */
|
|
5
2
|
import { latestStorageVersionState } from "../storage/upgrade/recordVersions.js";
|
|
6
3
|
import { runStorageUpgrade } from "../storage/upgrade/upgradeOrchestrator.js";
|
|
7
4
|
import { usageError } from "../errors/cliError.js";
|
|
@@ -41,7 +38,7 @@ export function renderUpgradeResult(result, mode) {
|
|
|
41
38
|
case "already-current":
|
|
42
39
|
return `${header}\nStorage is already at the current version; nothing to upgrade.`;
|
|
43
40
|
case "update-preflight":
|
|
44
|
-
return `${header}\nUpdate preflight:
|
|
41
|
+
return `${header}\nUpdate preflight: ${result.status} (${result.stepCount} steps). Storage was not modified.`;
|
|
45
42
|
case "blocked": {
|
|
46
43
|
return [
|
|
47
44
|
header,
|