@yu_robotics/remote-cli 1.6.247 → 1.6.251
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/dist/client/MessageHandler.d.ts +6 -2
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +99 -29
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/client/WebSocketClient.d.ts +3 -0
- package/dist/client/WebSocketClient.d.ts.map +1 -1
- package/dist/client/WebSocketClient.js +3 -1
- package/dist/client/WebSocketClient.js.map +1 -1
- package/dist/commands/start.d.ts +5 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +37 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +7 -1
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/files/FileInbox.d.ts +1 -0
- package/dist/files/FileInbox.d.ts.map +1 -1
- package/dist/files/FileInbox.js +49 -4
- package/dist/files/FileInbox.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/scheduling/ScheduleService.d.ts +20 -1
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +137 -36
- package/dist/scheduling/ScheduleService.js.map +1 -1
- package/dist/scheduling/ScheduleToolScope.d.ts.map +1 -1
- package/dist/scheduling/ScheduleToolScope.js +7 -0
- package/dist/scheduling/ScheduleToolScope.js.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts +7 -0
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js +121 -38
- package/dist/scheduling/claude/ClaudeSessionSchedules.js.map +1 -1
- package/dist/service/SessionHostSupervisor.d.ts +63 -0
- package/dist/service/SessionHostSupervisor.d.ts.map +1 -0
- package/dist/service/SessionHostSupervisor.js +323 -0
- package/dist/service/SessionHostSupervisor.js.map +1 -0
- package/dist/sessionHost/HostClient.d.ts +49 -0
- package/dist/sessionHost/HostClient.d.ts.map +1 -0
- package/dist/sessionHost/HostClient.js +101 -0
- package/dist/sessionHost/HostClient.js.map +1 -0
- package/dist/sessionHost/HostProtocol.d.ts +65 -0
- package/dist/sessionHost/HostProtocol.d.ts.map +1 -0
- package/dist/sessionHost/HostProtocol.js +78 -0
- package/dist/sessionHost/HostProtocol.js.map +1 -0
- package/dist/sessionHost/HostServer.d.ts +52 -0
- package/dist/sessionHost/HostServer.d.ts.map +1 -0
- package/dist/sessionHost/HostServer.js +413 -0
- package/dist/sessionHost/HostServer.js.map +1 -0
- package/dist/sessionHost/HostStore.d.ts +43 -0
- package/dist/sessionHost/HostStore.d.ts.map +1 -0
- package/dist/sessionHost/HostStore.js +206 -0
- package/dist/sessionHost/HostStore.js.map +1 -0
- package/dist/sessionHost/RetainedFrontend.d.ts +63 -0
- package/dist/sessionHost/RetainedFrontend.d.ts.map +1 -0
- package/dist/sessionHost/RetainedFrontend.js +244 -0
- package/dist/sessionHost/RetainedFrontend.js.map +1 -0
- package/dist/sessionHost/RetainedHostLauncher.d.ts +25 -0
- package/dist/sessionHost/RetainedHostLauncher.d.ts.map +1 -0
- package/dist/sessionHost/RetainedHostLauncher.js +132 -0
- package/dist/sessionHost/RetainedHostLauncher.js.map +1 -0
- package/dist/sessionHost/RetainedRuntime.d.ts +62 -0
- package/dist/sessionHost/RetainedRuntime.d.ts.map +1 -0
- package/dist/sessionHost/RetainedRuntime.js +478 -0
- package/dist/sessionHost/RetainedRuntime.js.map +1 -0
- package/dist/sessionHost/RuntimeJournal.d.ts +47 -0
- package/dist/sessionHost/RuntimeJournal.d.ts.map +1 -0
- package/dist/sessionHost/RuntimeJournal.js +103 -0
- package/dist/sessionHost/RuntimeJournal.js.map +1 -0
- package/dist/sessionHost/entry.d.ts +13 -0
- package/dist/sessionHost/entry.d.ts.map +1 -0
- package/dist/sessionHost/entry.js +107 -0
- package/dist/sessionHost/entry.js.map +1 -0
- package/dist/update/AutomaticUpdater.d.ts +2 -1
- package/dist/update/AutomaticUpdater.d.ts.map +1 -1
- package/dist/update/AutomaticUpdater.js +26 -12
- package/dist/update/AutomaticUpdater.js.map +1 -1
- package/dist/update/PinnedHostBundle.d.ts +49 -0
- package/dist/update/PinnedHostBundle.d.ts.map +1 -0
- package/dist/update/PinnedHostBundle.js +309 -0
- package/dist/update/PinnedHostBundle.js.map +1 -0
- package/native/prebuilds/darwin-arm64/managed_native.node +0 -0
- package/native/prebuilds/darwin-arm64/manifest.json +1 -1
- package/native/prebuilds/darwin-x64/managed_native.node +0 -0
- package/native/prebuilds/darwin-x64/manifest.json +1 -1
- package/native/prebuilds/win32-arm64/managed_native.node +0 -0
- package/native/prebuilds/win32-arm64/manifest.json +1 -1
- package/native/prebuilds/win32-x64/managed_native.node +0 -0
- package/native/prebuilds/win32-x64/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ export interface ScheduleServiceOptions {
|
|
|
46
46
|
provider: NativeScheduleProvider;
|
|
47
47
|
/** Reject when disconnected or not delivered. Success is not an exactly-once receipt. */
|
|
48
48
|
deliver: (delivery: ScheduleDelivery) => Promise<void>;
|
|
49
|
+
/** Retained hosts acknowledge native acceptance after persistence, not Router latency. */
|
|
50
|
+
deferDelivery?: boolean;
|
|
49
51
|
isOwnerCurrent: (owner: ScheduleOwner) => boolean;
|
|
50
52
|
/** Framework observation of late native mutations, never model-supplied proof. */
|
|
51
53
|
isNativeMutationPending?: (owner: ScheduleOwner) => boolean;
|
|
@@ -106,6 +108,8 @@ export declare class ScheduleService {
|
|
|
106
108
|
private suspending;
|
|
107
109
|
private handoffUnresolved;
|
|
108
110
|
private suspension?;
|
|
111
|
+
private hostRetirement?;
|
|
112
|
+
private hostsRetired;
|
|
109
113
|
constructor(options: ScheduleServiceOptions);
|
|
110
114
|
initialize(): Promise<void>;
|
|
111
115
|
/** Sequential startup/reconnect reconciliation. Never drives the native schedule clock. */
|
|
@@ -136,8 +140,23 @@ export declare class ScheduleService {
|
|
|
136
140
|
private forgetCleanup;
|
|
137
141
|
private retryCleanup;
|
|
138
142
|
private purgeRecord;
|
|
143
|
+
/** Durable outputs still awaiting their external delivery receipt. */
|
|
144
|
+
hasPendingResults(): boolean;
|
|
139
145
|
/** Includes terminal jobs whose native process exit is still unconfirmed. */
|
|
140
146
|
hasActiveSchedules(threadId?: string): boolean;
|
|
147
|
+
/** Admission to explicit process retirement, NOT proof of native exit or queue
|
|
148
|
+
* reconstruction. Only the original live handles can supply deletion receipts.
|
|
149
|
+
*/
|
|
150
|
+
canRetireDrainedHosts(): boolean;
|
|
151
|
+
/** Synchronous fence: no asynchronous gap between checking and revoking new
|
|
152
|
+
* schedule operations. Retain exact pre-exit deletion receipts for finalization.
|
|
153
|
+
*/
|
|
154
|
+
beginDrainedHostRetirement(): void;
|
|
155
|
+
/** Called only after the owner joined its original executor groups and drained
|
|
156
|
+
* native callback ingestion. Never calls stop/cancel/releaseForRestart on a
|
|
157
|
+
* provider. Failure preserves the same retirement fence, handles and catalog.
|
|
158
|
+
*/
|
|
159
|
+
finishDrainedHostRetirement(): Promise<void>;
|
|
141
160
|
/** Card eligibility includes retryable cleanup even for a terminal catalog record. */
|
|
142
161
|
canCancel(owner: ScheduleOwner, id: string): boolean;
|
|
143
162
|
/** Newly observed cleanup facts never supply historical recovery proof. The optional
|
|
@@ -145,7 +164,7 @@ export declare class ScheduleService {
|
|
|
145
164
|
recordReviewedCleanup(owner: ScheduleOwner, ids: string[], absent: boolean, retirementConfirmed?: () => boolean): Promise<void>;
|
|
146
165
|
/** Keep admitted native work visible when cleanup cannot safely acquire its host. */
|
|
147
166
|
retainCleanupError(owner: ScheduleOwner, id: string, error: unknown): Promise<void>;
|
|
148
|
-
/**
|
|
167
|
+
/** Observe native inventory without deleting definitions or retiring native work. */
|
|
149
168
|
refresh(owner: ScheduleOwner): Promise<void>;
|
|
150
169
|
private refreshNative;
|
|
151
170
|
cancel(owner: ScheduleOwner, id: string): Promise<ScheduleRecord>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleService.d.ts","sourceRoot":"","sources":["../../src/scheduling/ScheduleService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,sBAAsB,EAAsB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAO/I,OAAO,KAAK,EAA6C,mBAAmB,EAAE,sBAAsB,EAClG,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAA4C,MAAM,SAAS,CAAC;AAI7G,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAY7D,MAAM,MAAM,sBAAsB,GAAG;IAAE,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC;AACzG,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,kBAAkB,GAC7F,wBAAwB,GAAG,qBAAqB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AACzF;;6DAE6D;AAC7D,MAAM,MAAM,qBAAqB,GAC7B;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,SAAS,IAAI,OAAO,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,+FAA+F;IAC/F,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;IAClD,wF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,OAAO,CAAC,eAAe;YAYT,aAAa;IAS3B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,KAAK;IAMb,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,MAAM;YAMA,WAAW;IAgCzB,OAAO,CAAC,IAAI;YA8GE,OAAO;CA4BtB"}
|
|
@@ -143,6 +143,8 @@ class ScheduleService {
|
|
|
143
143
|
suspending = false;
|
|
144
144
|
handoffUnresolved = false;
|
|
145
145
|
suspension;
|
|
146
|
+
hostRetirement;
|
|
147
|
+
hostsRetired = false;
|
|
146
148
|
constructor(options) {
|
|
147
149
|
this.options = { ...options };
|
|
148
150
|
this.now = options.now ?? Date.now;
|
|
@@ -858,11 +860,87 @@ class ScheduleService {
|
|
|
858
860
|
return erase(evidence);
|
|
859
861
|
});
|
|
860
862
|
}
|
|
863
|
+
/** Durable outputs still awaiting their external delivery receipt. */
|
|
864
|
+
hasPendingResults() { return this.pending.size > 0; }
|
|
861
865
|
/** Includes terminal jobs whose native process exit is still unconfirmed. */
|
|
862
866
|
hasActiveSchedules(threadId) {
|
|
863
867
|
return [...this.records.values()].some(record => (!threadId || record.threadId === threadId)
|
|
864
868
|
&& (LIVE.has(record.state) || recoveryOwnsWork(record) || (this.runtimes.has(record.id) && !this.runtimes.get(record.id).stopped)));
|
|
865
869
|
}
|
|
870
|
+
/** Admission to explicit process retirement, NOT proof of native exit or queue
|
|
871
|
+
* reconstruction. Only the original live handles can supply deletion receipts.
|
|
872
|
+
*/
|
|
873
|
+
canRetireDrainedHosts() {
|
|
874
|
+
if (!this.initialized || this.closing || this.fault || this.hostRetirement || this.suspending
|
|
875
|
+
|| this.handoffUnresolved || this.recoveryRun || this.operations.size || this.tasks.size
|
|
876
|
+
|| this.recordOperations.size || this.pending.size || this.delivering.size || this.refreshes
|
|
877
|
+
|| this.retainedCancellations.size || this.purges.size || this.cleanup.size)
|
|
878
|
+
return false;
|
|
879
|
+
try {
|
|
880
|
+
this.catalogGate?.verify();
|
|
881
|
+
return [...this.records.values()].every(record => {
|
|
882
|
+
if (record.error || record.recovery || !this.current(record) || this.options.isNativeMutationPending?.(ownerOf(record)))
|
|
883
|
+
return false;
|
|
884
|
+
const runtime = this.runtimes.get(record.id);
|
|
885
|
+
if (!runtime)
|
|
886
|
+
return record.state === 'cancelled' && record.cancelRequested === true && record.cleanupConfirmed === true;
|
|
887
|
+
if (!runtime.handle || runtime.running.size || runtime.heldDeliveries.size || runtime.cancelling || runtime.releasing)
|
|
888
|
+
return false;
|
|
889
|
+
if (record.state === 'completed')
|
|
890
|
+
return record.rule.kind === 'once' && runtime.completed.size > 0;
|
|
891
|
+
return record.state === 'cancelled' && record.cancelRequested === true && runtime.removalConfirmed === true
|
|
892
|
+
&& (runtime.handle.nativeDefinitionAbsent === true || runtime.stopped && record.cleanupConfirmed === true);
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
catch {
|
|
896
|
+
return false;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
/** Synchronous fence: no asynchronous gap between checking and revoking new
|
|
900
|
+
* schedule operations. Retain exact pre-exit deletion receipts for finalization.
|
|
901
|
+
*/
|
|
902
|
+
beginDrainedHostRetirement() {
|
|
903
|
+
if (this.hostRetirement)
|
|
904
|
+
return;
|
|
905
|
+
if (!this.canRetireDrainedHosts())
|
|
906
|
+
throw new Error('Native schedules are not drained for explicit host retirement.');
|
|
907
|
+
this.hostRetirement = new Map([...this.runtimes].map(([id, runtime]) => [id,
|
|
908
|
+
{ runtime, cancelled: this.records.get(id)?.cancelRequested === true && runtime.removalConfirmed === true }]));
|
|
909
|
+
}
|
|
910
|
+
/** Called only after the owner joined its original executor groups and drained
|
|
911
|
+
* native callback ingestion. Never calls stop/cancel/releaseForRestart on a
|
|
912
|
+
* provider. Failure preserves the same retirement fence, handles and catalog.
|
|
913
|
+
*/
|
|
914
|
+
async finishDrainedHostRetirement() {
|
|
915
|
+
if (!this.hostRetirement)
|
|
916
|
+
throw new Error('Explicit host retirement was not admitted.');
|
|
917
|
+
while (this.tasks.size)
|
|
918
|
+
await Promise.allSettled([...this.tasks]);
|
|
919
|
+
await this.deliveryTail;
|
|
920
|
+
await this.serial(async () => {
|
|
921
|
+
if (this.fault)
|
|
922
|
+
throw this.fault;
|
|
923
|
+
if (this.pending.size || this.operations.size || this.recordOperations.size || this.delivering.size)
|
|
924
|
+
throw new Error('Native retirement still owns pending work or output.');
|
|
925
|
+
for (const [id, proof] of this.hostRetirement) {
|
|
926
|
+
const runtime = this.runtimes.get(id), record = this.records.get(id);
|
|
927
|
+
if (runtime !== proof.runtime || !record || runtime.running.size || runtime.heldDeliveries.size
|
|
928
|
+
|| !(runtime.stopped || runtime.handle?.retirementConfirmed === true))
|
|
929
|
+
throw new Error('Exact native host retirement is unconfirmed.');
|
|
930
|
+
}
|
|
931
|
+
for (const [id, proof] of this.hostRetirement) {
|
|
932
|
+
proof.runtime.stopped = true;
|
|
933
|
+
proof.runtime.releaseAdmission?.();
|
|
934
|
+
proof.runtime.releaseAdmission = undefined;
|
|
935
|
+
// AGY invalidates its inventory view after exit. Preserve the exact
|
|
936
|
+
// deletion receipt captured BEFORE exit rather than querying a new host.
|
|
937
|
+
if (proof.cancelled)
|
|
938
|
+
this.records.get(id).cleanupConfirmed = true;
|
|
939
|
+
}
|
|
940
|
+
await this.persist();
|
|
941
|
+
this.hostsRetired = true;
|
|
942
|
+
});
|
|
943
|
+
}
|
|
866
944
|
/** Card eligibility includes retryable cleanup even for a terminal catalog record. */
|
|
867
945
|
canCancel(owner, id) {
|
|
868
946
|
this.checkReady();
|
|
@@ -923,50 +1001,60 @@ class ScheduleService {
|
|
|
923
1001
|
await this.persist();
|
|
924
1002
|
});
|
|
925
1003
|
}
|
|
926
|
-
/**
|
|
1004
|
+
/** Observe native inventory without deleting definitions or retiring native work. */
|
|
927
1005
|
refresh(owner) {
|
|
928
1006
|
this.refreshes++;
|
|
929
|
-
return this.operation(this.refreshNative(owner).finally(() => { this.refreshes--; }));
|
|
1007
|
+
return this.operation(this.refreshNative(structuredClone(owner)).finally(() => { this.refreshes--; }));
|
|
930
1008
|
}
|
|
931
1009
|
async refreshNative(owner) {
|
|
932
1010
|
this.checkReady();
|
|
933
1011
|
validateOwner(owner);
|
|
934
1012
|
const candidates = await this.serial(async () => [...this.records.values()]
|
|
935
1013
|
.filter(record => sameOwner(record, owner)).map(record => record.id));
|
|
1014
|
+
let failure;
|
|
936
1015
|
for (const id of candidates) {
|
|
1016
|
+
const record = this.records.get(id);
|
|
937
1017
|
const runtime = this.runtimes.get(id);
|
|
938
|
-
|
|
1018
|
+
const handle = runtime?.handle;
|
|
1019
|
+
if (!record || !runtime || !handle)
|
|
939
1020
|
continue;
|
|
940
|
-
|
|
941
|
-
|
|
1021
|
+
const nativeId = record.nativeId;
|
|
1022
|
+
const completed = runtime.completed.size;
|
|
1023
|
+
// Recheck after every read: cancellation, execution or rebound may have
|
|
1024
|
+
// advanced while inventory was awaiting its native receipt.
|
|
1025
|
+
const readable = () => !this.closing && !this.fault && !this.suspending && this.current(owner)
|
|
1026
|
+
&& this.records.get(id) === record && record.nativeId === nativeId && record.state === 'active' && !record.cancelRequested
|
|
1027
|
+
&& this.runtimes.get(id) === runtime && runtime.handle === handle && !runtime.stopped && !runtime.cancelling
|
|
1028
|
+
&& !runtime.running.size && runtime.completed.size === completed && !runtime.stopPromise && !runtime.releaseAdmission
|
|
1029
|
+
&& !this.recordOperations.has(id) && !this.retainedCancellations.has(id);
|
|
1030
|
+
if (!readable())
|
|
942
1031
|
continue;
|
|
943
|
-
|
|
1032
|
+
let present;
|
|
944
1033
|
try {
|
|
945
|
-
|
|
946
|
-
if (present)
|
|
947
|
-
|
|
948
|
-
await this.serial(async () => {
|
|
949
|
-
const record = this.records.get(id);
|
|
950
|
-
if (LIVE.has(record.state)) {
|
|
951
|
-
record.state = 'interrupted';
|
|
952
|
-
record.error = 'Native schedule is no longer listed; execution completion is not confirmed.';
|
|
953
|
-
await this.persist();
|
|
954
|
-
}
|
|
955
|
-
});
|
|
956
|
-
await this.stop(id, runtime);
|
|
1034
|
+
present = await handle.list();
|
|
1035
|
+
if (typeof present !== 'boolean')
|
|
1036
|
+
throw new Error('Native inventory returned no verified presence or absence.');
|
|
957
1037
|
}
|
|
958
1038
|
catch (error) {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
if (!this.fault)
|
|
965
|
-
await this.persist();
|
|
966
|
-
});
|
|
967
|
-
await this.stop(id, runtime);
|
|
1039
|
+
// Read uncertainty is not absence or cancellation authority. Leave the
|
|
1040
|
+
// durable record, recovery fences and future occurrence admission intact.
|
|
1041
|
+
if (readable())
|
|
1042
|
+
failure ??= new Error(`Native inventory could not be verified for ${id}: ${errorText(error)}`);
|
|
1043
|
+
continue;
|
|
968
1044
|
}
|
|
1045
|
+
if (present)
|
|
1046
|
+
continue;
|
|
1047
|
+
await this.serial(async () => {
|
|
1048
|
+
if (!readable())
|
|
1049
|
+
return;
|
|
1050
|
+
record.state = 'interrupted';
|
|
1051
|
+
const detail = 'Native schedule is no longer listed; execution completion and cleanup are not confirmed.';
|
|
1052
|
+
record.error = record.error ? `${bounded(record.error, ERROR_BYTES - Buffer.byteLength(detail) - 1)}\n${detail}` : detail;
|
|
1053
|
+
await this.persist();
|
|
1054
|
+
});
|
|
969
1055
|
}
|
|
1056
|
+
if (failure)
|
|
1057
|
+
throw failure;
|
|
970
1058
|
}
|
|
971
1059
|
cancel(owner, id) {
|
|
972
1060
|
return this.operation(this.recordOperation(id, this.cancelSchedule(owner, id)));
|
|
@@ -1086,7 +1174,7 @@ class ScheduleService {
|
|
|
1086
1174
|
}
|
|
1087
1175
|
/** Snapshot eligibility is only admission to a handoff, never permission to install. */
|
|
1088
1176
|
canSuspendForRestart() {
|
|
1089
|
-
if (!this.initialized || this.closing || this.fault || this.suspending || this.recoveryRun || this.operations.size || this.pending.size)
|
|
1177
|
+
if (!this.initialized || this.closing || this.hostRetirement || this.fault || this.suspending || this.recoveryRun || this.operations.size || this.pending.size)
|
|
1090
1178
|
return false;
|
|
1091
1179
|
return [...this.records.values()].filter(record => LIVE.has(record.state) || recoveryOwnsWork(record)
|
|
1092
1180
|
|| !!this.runtimes.get(record.id) && !this.runtimes.get(record.id).stopped).every(record => {
|
|
@@ -1228,6 +1316,8 @@ class ScheduleService {
|
|
|
1228
1316
|
return [...this.records.values()].some(record => !!record.recovery);
|
|
1229
1317
|
}
|
|
1230
1318
|
destroy() {
|
|
1319
|
+
if (this.hostRetirement && !this.hostsRetired)
|
|
1320
|
+
return Promise.reject(new Error('Explicit native host retirement remains unresolved.'));
|
|
1231
1321
|
if (this.destruction)
|
|
1232
1322
|
return this.destruction;
|
|
1233
1323
|
const preserve = !this.closing && this.hasActiveSchedules() && this.canSuspendForRestart();
|
|
@@ -1370,6 +1460,10 @@ class ScheduleService {
|
|
|
1370
1460
|
if (this.fault)
|
|
1371
1461
|
throw this.fault;
|
|
1372
1462
|
const record = this.records.get(id);
|
|
1463
|
+
if (this.hostRetirement && (event.type === 'started' || event.type === 'rebound'
|
|
1464
|
+
|| (event.type === 'completed' || event.type === 'skipped') && !runtime.completed.has(event.occurrenceId))) {
|
|
1465
|
+
throw new Error('Unexpected native work during explicit retirement; retain the native event journal.');
|
|
1466
|
+
}
|
|
1373
1467
|
if (this.suspending && event.type === 'stopped') {
|
|
1374
1468
|
if (event.exitConfirmed === false)
|
|
1375
1469
|
throw new Error('Native handoff exit unconfirmed.');
|
|
@@ -1502,8 +1596,13 @@ class ScheduleService {
|
|
|
1502
1596
|
// Persistence failures still set the service fault inside persist().
|
|
1503
1597
|
if (cleanup && !runtime.cancelling)
|
|
1504
1598
|
this.track(this.stop(id, runtime).catch(() => { }));
|
|
1505
|
-
if (delivery)
|
|
1506
|
-
|
|
1599
|
+
if (delivery) {
|
|
1600
|
+
const delivering = this.attemptDeliveries([delivery], true);
|
|
1601
|
+
if (this.options.deferDelivery)
|
|
1602
|
+
this.track(delivering);
|
|
1603
|
+
else
|
|
1604
|
+
await delivering;
|
|
1605
|
+
}
|
|
1507
1606
|
}
|
|
1508
1607
|
attemptDeliveries(ids, firstAttempt = false) {
|
|
1509
1608
|
const run = this.deliveryTail.then(async () => {
|
|
@@ -1627,7 +1726,7 @@ class ScheduleService {
|
|
|
1627
1726
|
}
|
|
1628
1727
|
canAdmitOccurrence(id, runtime) {
|
|
1629
1728
|
const record = this.records.get(id);
|
|
1630
|
-
return !!record && this.runtimes.get(id) === runtime && !this.closing && !this.fault
|
|
1729
|
+
return !!record && this.runtimes.get(id) === runtime && !this.closing && !this.hostRetirement && !this.fault
|
|
1631
1730
|
&& !runtime.stopped && !runtime.cancelling && !record.cancelRequested
|
|
1632
1731
|
&& LIVE.has(record.state) && this.current(record);
|
|
1633
1732
|
}
|
|
@@ -1641,8 +1740,9 @@ class ScheduleService {
|
|
|
1641
1740
|
void task.catch(error => {
|
|
1642
1741
|
// Persistence/protocol failures fail closed and stop native producers.
|
|
1643
1742
|
this.fault ??= error instanceof Error ? error : new Error('Schedule service failed.');
|
|
1644
|
-
|
|
1645
|
-
|
|
1743
|
+
if (!this.hostRetirement)
|
|
1744
|
+
for (const [id, runtime] of this.runtimes)
|
|
1745
|
+
void this.stop(id, runtime).catch(() => { });
|
|
1646
1746
|
}).finally(() => this.tasks.delete(task));
|
|
1647
1747
|
}
|
|
1648
1748
|
operation(task) {
|
|
@@ -1682,7 +1782,7 @@ class ScheduleService {
|
|
|
1682
1782
|
checkReady() {
|
|
1683
1783
|
if (this.fault)
|
|
1684
1784
|
throw this.fault;
|
|
1685
|
-
if (!this.initialized || this.closing || this.suspending)
|
|
1785
|
+
if (!this.initialized || this.closing || this.hostRetirement || this.suspending)
|
|
1686
1786
|
throw new Error('Schedule service is not initialized or is closed.');
|
|
1687
1787
|
}
|
|
1688
1788
|
serial(operation) {
|
|
@@ -1914,8 +2014,9 @@ class ScheduleService {
|
|
|
1914
2014
|
}
|
|
1915
2015
|
catch (error) {
|
|
1916
2016
|
this.fault = error instanceof Error ? error : new Error('Schedule catalog write failed.');
|
|
1917
|
-
|
|
1918
|
-
|
|
2017
|
+
if (!this.hostRetirement)
|
|
2018
|
+
for (const [id, runtime] of this.runtimes)
|
|
2019
|
+
void this.stop(id, runtime).catch(() => { });
|
|
1919
2020
|
throw this.fault;
|
|
1920
2021
|
}
|
|
1921
2022
|
finally {
|