@zq-silk/yui 0.14.1 → 0.15.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 +91 -47
- package/README.md +275 -145
- 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/updateCommand.js +17 -9
- package/dist/cli/updateOrchestrator.js +87 -19
- package/dist/cli/updatePorts.js +79 -13
- package/dist/cli/upgradeCommand.js +105 -23
- 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/controllerCommands.js +1 -1
- 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/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 +6 -5
- package/dist/doctor/doctor.js +37 -14
- 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 +16 -82
- 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/observability/runtimeIdentity.js +48 -50
- package/dist/profile/agentProfile.js +60 -15
- package/dist/profile/agentProfileRuntime.js +100 -0
- package/dist/release/releaseWorkflowPorts.js +5 -68
- package/dist/release/runtimeRelease.js +9 -1
- 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 +22 -296
- 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/currentTaskStore.js +6 -4
- package/dist/storage/sqliteSchema.js +135 -80
- package/dist/storage/sqliteStore.js +69 -52
- package/dist/storage/storageSchema.js +92 -230
- package/dist/storage/storageVersions.js +12 -13
- package/dist/storage/taskStore.js +8 -8
- package/dist/storage/upgrade/upgradeOrchestrator.js +276 -85
- 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/version.js +3 -3
- 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 +9 -9
- package/i18n/README.zh-CN.md +189 -74
- 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 +22 -0
- 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/storage/upgrade/recordVersions.js +0 -82
- package/dist/task/repairWave.js +0 -150
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export function assertDraftTaskExecutionFree(store, task) {
|
|
2
|
+
if (task.status !== "draft") {
|
|
3
|
+
throw new Error(`Task is not a Draft: ${task.id}/${task.status}.`);
|
|
4
|
+
}
|
|
5
|
+
const executionFact = firstDraftExecutionFact(store, task);
|
|
6
|
+
if (executionFact !== undefined) {
|
|
7
|
+
throw new Error(`Draft Task ${task.id} has execution facts (${executionFact}); `
|
|
8
|
+
+ "retire it and create a clean Draft instead of editing runtime history.");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function validateDraftWorkItemEdit(store, task, candidate) {
|
|
12
|
+
assertDraftTaskExecutionFree(store, task);
|
|
13
|
+
const workItems = store.listWorkItems(task.id).map((item) => (item.id === candidate.id ? candidate : item));
|
|
14
|
+
const facts = draftPlanFacts(store, task, workItems);
|
|
15
|
+
validateWorkItemReferences(facts, candidate);
|
|
16
|
+
assertDraftWorkItemDependencyGraph(facts.workItems, candidate);
|
|
17
|
+
}
|
|
18
|
+
export function validateDraftTaskForActivation(store, task) {
|
|
19
|
+
assertDraftTaskExecutionFree(store, task);
|
|
20
|
+
const facts = draftPlanFacts(store, task, store.listWorkItems(task.id));
|
|
21
|
+
const current = facts.workItems.filter(({ status }) => status !== "retired");
|
|
22
|
+
for (const item of current)
|
|
23
|
+
validateWorkItemReferences(facts, item);
|
|
24
|
+
assertDraftWorkItemDependencyGraph(current);
|
|
25
|
+
}
|
|
26
|
+
/** Derive the first invalid edge in the current Draft dependency graph. */
|
|
27
|
+
export function draftWorkItemDependencyIssue(workItems, onlyItem) {
|
|
28
|
+
const current = workItems.filter(({ status }) => status !== "retired");
|
|
29
|
+
const byId = new Map(current.map((item) => [item.id, item]));
|
|
30
|
+
for (const item of onlyItem === undefined ? current : [onlyItem]) {
|
|
31
|
+
const dependencyId = item.dependsOn.find((id) => !byId.has(id));
|
|
32
|
+
if (dependencyId !== undefined) {
|
|
33
|
+
return { kind: "missing-or-retired", workItemId: item.id, dependencyId };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const visiting = new Set();
|
|
37
|
+
const visited = new Set();
|
|
38
|
+
const visit = (item) => {
|
|
39
|
+
visiting.add(item.id);
|
|
40
|
+
for (const dependencyId of item.dependsOn) {
|
|
41
|
+
if (visiting.has(dependencyId)) {
|
|
42
|
+
return { kind: "cycle", workItemId: item.id, dependencyId };
|
|
43
|
+
}
|
|
44
|
+
if (visited.has(dependencyId))
|
|
45
|
+
continue;
|
|
46
|
+
const dependency = byId.get(dependencyId);
|
|
47
|
+
if (dependency === undefined)
|
|
48
|
+
continue;
|
|
49
|
+
const issue = visit(dependency);
|
|
50
|
+
if (issue !== undefined)
|
|
51
|
+
return issue;
|
|
52
|
+
}
|
|
53
|
+
visiting.delete(item.id);
|
|
54
|
+
visited.add(item.id);
|
|
55
|
+
return undefined;
|
|
56
|
+
};
|
|
57
|
+
for (const item of current) {
|
|
58
|
+
if (visited.has(item.id))
|
|
59
|
+
continue;
|
|
60
|
+
const issue = visit(item);
|
|
61
|
+
if (issue !== undefined)
|
|
62
|
+
return issue;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
function draftPlanFacts(store, task, workItems) {
|
|
67
|
+
const projects = new Map();
|
|
68
|
+
for (const binding of task.projectBindings) {
|
|
69
|
+
const project = store.getProject(binding.projectId);
|
|
70
|
+
if (project === null) {
|
|
71
|
+
throw new Error(`Task Project not found: ${binding.projectId}.`);
|
|
72
|
+
}
|
|
73
|
+
if (project.status !== "active") {
|
|
74
|
+
throw new Error(`Task Project is not active: ${project.id}/${project.status}.`);
|
|
75
|
+
}
|
|
76
|
+
projects.set(project.id, project);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
task,
|
|
80
|
+
workItems,
|
|
81
|
+
roleNames: new Set(store.listRoles(task.id).map(({ name }) => name)),
|
|
82
|
+
projects
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function validateWorkItemReferences(facts, item) {
|
|
86
|
+
if (item.assignee !== undefined && !facts.roleNames.has(item.assignee)) {
|
|
87
|
+
throw new Error(`Work Item assignee Role not found: ${item.id}/${item.assignee}.`);
|
|
88
|
+
}
|
|
89
|
+
for (const projectId of item.writeProjectIds) {
|
|
90
|
+
if (!facts.projects.has(projectId)) {
|
|
91
|
+
throw new Error(`Work Item writable Project is not bound: ${item.id}/${projectId}.`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (const baseRef of item.baseRefs ?? []) {
|
|
95
|
+
if (!item.writeProjectIds.includes(baseRef.projectId)) {
|
|
96
|
+
throw new Error(`Work Item base-ref Project is not writable: ${item.id}/${baseRef.projectId}.`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function assertDraftWorkItemDependencyGraph(workItems, onlyItem) {
|
|
101
|
+
const issue = draftWorkItemDependencyIssue(workItems, onlyItem);
|
|
102
|
+
if (issue === undefined)
|
|
103
|
+
return;
|
|
104
|
+
if (issue.kind === "missing-or-retired") {
|
|
105
|
+
throw new Error(`Work Item dependency is missing or retired: ${issue.workItemId}/${issue.dependencyId}.`);
|
|
106
|
+
}
|
|
107
|
+
throw new Error(`Work Item dependency cycle detected: ${issue.workItemId}/${issue.dependencyId}.`);
|
|
108
|
+
}
|
|
109
|
+
function firstDraftExecutionFact(store, task) {
|
|
110
|
+
if (task.workspaceIdentity !== undefined || task.cwd !== undefined)
|
|
111
|
+
return "Task workspace";
|
|
112
|
+
const hostOwner = store.listSessionOwners().find(({ owner }) => (owner.scope === "task" && owner.taskId === task.id));
|
|
113
|
+
if (hostOwner !== undefined)
|
|
114
|
+
return `Host owner (${hostOwner.runtimeGenerationId})`;
|
|
115
|
+
if (store.listTurns(task.id).length > 0)
|
|
116
|
+
return "Turn";
|
|
117
|
+
if (store.listRoleSessionSets(task.id).length > 0)
|
|
118
|
+
return "Role Session";
|
|
119
|
+
if (store.listDurableJobs(task.id).length > 0)
|
|
120
|
+
return "DurableJob";
|
|
121
|
+
if (store.listManagedWorkspaces(task.id).length > 0)
|
|
122
|
+
return "managed Workspace";
|
|
123
|
+
if (store.listReviewRounds(task.id).length > 0)
|
|
124
|
+
return "ReviewRound";
|
|
125
|
+
if (store.listIntegrationAttempts(task.id).length > 0)
|
|
126
|
+
return "Integration Attempt";
|
|
127
|
+
if (store.listChangeSets(task.id).length > 0)
|
|
128
|
+
return "ChangeSet";
|
|
129
|
+
const itemWithExecution = store.listWorkItems(task.id).find((item) => (item.executionGroups.length > 0
|
|
130
|
+
|| item.currentExecutionGroupId !== undefined
|
|
131
|
+
|| item.candidates.length > 0
|
|
132
|
+
|| item.workspaceDisposition !== undefined
|
|
133
|
+
|| !["pending", "retired"].includes(item.status)));
|
|
134
|
+
if (itemWithExecution !== undefined) {
|
|
135
|
+
return `Work Item execution (${itemWithExecution.id})`;
|
|
136
|
+
}
|
|
137
|
+
const runtimeEvent = store.listEvents(task.id).find(({ type }) => (type.startsWith("runtime.")
|
|
138
|
+
|| type.startsWith("turn.")
|
|
139
|
+
|| type.startsWith("review.")
|
|
140
|
+
|| type.startsWith("integration.")));
|
|
141
|
+
return runtimeEvent === undefined ? undefined : `event ${runtimeEvent.id}/${runtimeEvent.type}`;
|
|
142
|
+
}
|