@yu_robotics/remote-cli 1.6.251 → 1.6.253
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.map +1 -1
- package/dist/client/MessageHandler.js +4 -3
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +54 -8
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/scheduling/ReviewedNativeCleanup.d.ts +1 -1
- package/dist/scheduling/ReviewedNativeCleanup.d.ts.map +1 -1
- package/dist/scheduling/ScheduleCleanup.d.ts +1 -0
- package/dist/scheduling/ScheduleCleanup.d.ts.map +1 -1
- package/dist/scheduling/ScheduleCleanup.js +2 -1
- package/dist/scheduling/ScheduleCleanup.js.map +1 -1
- package/dist/scheduling/SchedulePurgeVerification.js +4 -4
- package/dist/scheduling/SchedulePurgeVerification.js.map +1 -1
- package/dist/scheduling/ScheduleService.d.ts +5 -1
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +136 -28
- package/dist/scheduling/ScheduleService.js.map +1 -1
- package/dist/scheduling/claude/ClaudeScheduleOwnership.d.ts +15 -3
- package/dist/scheduling/claude/ClaudeScheduleOwnership.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeScheduleOwnership.js +111 -7
- package/dist/scheduling/claude/ClaudeScheduleOwnership.js.map +1 -1
- package/dist/scheduling/claude/ClaudeScheduleProcesses.d.ts +14 -0
- package/dist/scheduling/claude/ClaudeScheduleProcesses.d.ts.map +1 -0
- package/dist/scheduling/claude/ClaudeScheduleProcesses.js +86 -0
- package/dist/scheduling/claude/ClaudeScheduleProcesses.js.map +1 -0
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts +6 -0
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js +35 -2
- package/dist/scheduling/claude/ClaudeSessionSchedules.js.map +1 -1
- package/dist/scheduling/types.d.ts +4 -0
- package/dist/scheduling/types.d.ts.map +1 -1
- package/dist/scheduling/types.js +6 -1
- package/dist/scheduling/types.js.map +1 -1
- 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
|
@@ -12,7 +12,7 @@ export interface NativeCleanupSession {
|
|
|
12
12
|
sessionId: string;
|
|
13
13
|
/** Framework-captured location and retirement proof, never model arguments. */
|
|
14
14
|
cwd?: string;
|
|
15
|
-
retirementConfirmed?(): boolean;
|
|
15
|
+
retirementConfirmed?(ownerToken?: string): boolean;
|
|
16
16
|
/** Unsettled mutation receipts retain their operational record. */
|
|
17
17
|
mutationPending?(): boolean;
|
|
18
18
|
current(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewedNativeCleanup.d.ts","sourceRoot":"","sources":["../../src/scheduling/ReviewedNativeCleanup.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IACjF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AACD,MAAM,WAAW,oBAAoB;IACnC,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,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AAa,GAAG,qBAAqB,CAoBlG;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,qBAAqB;;;;;;;;EAI3D;AACD,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -28,7 +28,8 @@ function cleanupRecord(record, reason) {
|
|
|
28
28
|
&& !/[\x00-\x1f\x7f]/.test(identity.sessionId)
|
|
29
29
|
&& (record.backend !== 'claude' || /^[a-f0-9-]{36}$/.test(identity.marker ?? ''))) {
|
|
30
30
|
result.attribution = { sessionId: identity.sessionId, promptHash: promptHash(record.prompt), rule: structuredClone(record.rule),
|
|
31
|
-
...(record.backend === 'claude' ? { marker: identity.marker
|
|
31
|
+
...(record.backend === 'claude' ? { marker: identity.marker,
|
|
32
|
+
...(/^[a-f0-9-]{36}$/.test(identity.ownerToken ?? '') && { ownerToken: identity.ownerToken }) } : {}) };
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
catch { /* Missing or malformed legacy attribution is not invented. */ }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleCleanup.js","sourceRoot":"","sources":["../../src/scheduling/ScheduleCleanup.ts"],"names":[],"mappings":";;AAcA,sCAIC;AACD,gCAAgH;AAEhH,
|
|
1
|
+
{"version":3,"file":"ScheduleCleanup.js","sourceRoot":"","sources":["../../src/scheduling/ScheduleCleanup.ts"],"names":[],"mappings":";;AAcA,sCAIC;AACD,gCAAgH;AAEhH,sCAoBC;AAED,wCAIC;AA/CD,6CAAyC;AAczC,SAAgB,aAAa,CAAC,MAAqB;IACjD,IAAI,MAAM,KAAK,cAAc;QAAE,OAAO,kPAAkP,CAAC;IACzR,IAAI,MAAM,KAAK,qBAAqB;QAAE,OAAO,sKAAsK,CAAC;IACpN,OAAO,6KAA6K,CAAC;AACvL,CAAC;AACD,SAAgB,UAAU,CAAC,MAAc,IAAY,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAA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AW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -38,9 +38,9 @@ async function verifySchedulePurge(record, host, current, accept) {
|
|
|
38
38
|
const marker = `[remote-cli:${identity.marker}]`;
|
|
39
39
|
if (entries.some(entry => entry.id === record.nativeId || entry.prompt.includes(marker)))
|
|
40
40
|
return unresolved('native_absence_unknown', 'The original native ID or marker is still present. Use cleanup review/delete for the exact definition, then retry these managed IDs; siblings are never swept.');
|
|
41
|
-
if (!host.retirementConfirmed?.())
|
|
41
|
+
if (!host.retirementConfirmed?.(identity.ownerToken))
|
|
42
42
|
return unresolved('predecessor_unknown', 'Fresh original-session inventory confirms definition absence, but predecessor or admitted work is unconfirmed. Cancellation intent is saved; native cleanup remains unresolved until framework retirement proof is available.');
|
|
43
|
-
return accept({ status: 'verified', isCurrent: () => valid() && !host.mutationPending?.() && host.retirementConfirmed?.() === true });
|
|
43
|
+
return accept({ status: 'verified', isCurrent: () => valid() && !host.mutationPending?.() && host.retirementConfirmed?.(identity.ownerToken) === true });
|
|
44
44
|
}
|
|
45
45
|
/** A digest preserves exact deletion attribution after user text has been erased.
|
|
46
46
|
* This callback has no execution or recovery path and never searches sessions. */
|
|
@@ -89,8 +89,8 @@ async function verifyCleanup(record, host, current, accept) {
|
|
|
89
89
|
if (identity(after) !== identity(entries.filter(entry => entry.id !== target.id)))
|
|
90
90
|
return unresolved('native_absence_unknown');
|
|
91
91
|
}
|
|
92
|
-
if (!host.retirementConfirmed?.())
|
|
92
|
+
if (!host.retirementConfirmed?.(a.ownerToken))
|
|
93
93
|
return unresolved('predecessor_unknown');
|
|
94
|
-
return accept({ status: 'verified', isCurrent: () => valid() && !host.mutationPending?.() && host.retirementConfirmed?.() === true });
|
|
94
|
+
return accept({ status: 'verified', isCurrent: () => valid() && !host.mutationPending?.() && host.retirementConfirmed?.(a.ownerToken) === true });
|
|
95
95
|
}
|
|
96
96
|
//# sourceMappingURL=SchedulePurgeVerification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchedulePurgeVerification.js","sourceRoot":"","sources":["../../src/scheduling/SchedulePurgeVerification.ts"],"names":[],"mappings":";;AAOA,kDA8BC;AArCD,uDAA2E;AAC3E,mEAAwG;AAIxG;gFACgF;AACzE,KAAK,UAAU,mBAAmB,CAAI,MAAwD,EAAE,IAAsC,EAC3I,OAAsB,EAAE,MAAuD;IAC/E,MAAM,UAAU,GAAG,CAAC,MAAyE,EAAE,MAAc,EAAE,EAAE,CAC/G,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,qEAAqE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtN,IAAI,IAAI,EAAE,eAAe,EAAE,EAAE;QAAE,OAAO,UAAU,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC;IACvG,IAAI,gBAAgB,IAAI,MAAM;QAAE,OAAO,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACpF,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC,cAAc,EACxE,iMAAiM,CAAC,CAAC;IACrM,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,qBAAqB,EACtE,gLAAgL,CAAC,CAAC;IACpL,IAAI,
|
|
1
|
+
{"version":3,"file":"SchedulePurgeVerification.js","sourceRoot":"","sources":["../../src/scheduling/SchedulePurgeVerification.ts"],"names":[],"mappings":";;AAOA,kDA8BC;AArCD,uDAA2E;AAC3E,mEAAwG;AAIxG;gFACgF;AACzE,KAAK,UAAU,mBAAmB,CAAI,MAAwD,EAAE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@ export declare class ScheduleService {
|
|
|
115
115
|
/** Sequential startup/reconnect reconciliation. Never drives the native schedule clock. */
|
|
116
116
|
recover(): Promise<void>;
|
|
117
117
|
private recoverWaiting;
|
|
118
|
+
private releaseRecoveryAdmission;
|
|
118
119
|
private checkpoint;
|
|
119
120
|
private validateCheckpoint;
|
|
120
121
|
private recoveryDiagnostic;
|
|
121
122
|
private blockRecovery;
|
|
122
123
|
create(owner: ScheduleOwner, input: NativeScheduleInput): Promise<ScheduleRecord>;
|
|
123
124
|
private createSchedule;
|
|
125
|
+
/** Called under the catalog serial queue, never through output-erasing purge.
|
|
126
|
+
* A refusal is proof about this fresh attempt, not historical native absence. */
|
|
127
|
+
private compactRefusedCreation;
|
|
124
128
|
/** Catalog lookup only; this does not probe or recreate native jobs. */
|
|
125
129
|
list(owner: ScheduleOwner): Promise<ScheduleRecord[]>;
|
|
126
130
|
/** Operational deletion ledger, separate from user history and never recoverable. */
|
|
@@ -161,7 +165,7 @@ export declare class ScheduleService {
|
|
|
161
165
|
canCancel(owner: ScheduleOwner, id: string): boolean;
|
|
162
166
|
/** Newly observed cleanup facts never supply historical recovery proof. The optional
|
|
163
167
|
* retirement callback is framework-owned and checked under the native cleanup lease. */
|
|
164
|
-
recordReviewedCleanup(owner: ScheduleOwner, ids: string[], absent: boolean, retirementConfirmed?: () => boolean): Promise<void>;
|
|
168
|
+
recordReviewedCleanup(owner: ScheduleOwner, ids: string[], absent: boolean, retirementConfirmed?: (record: Readonly<ScheduleRecord>) => boolean): Promise<void>;
|
|
165
169
|
/** Keep admitted native work visible when cleanup cannot safely acquire its host. */
|
|
166
170
|
retainCleanupError(owner: ScheduleOwner, id: string, error: unknown): Promise<void>;
|
|
167
171
|
/** Observe native inventory without deleting definitions or retiring native work. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleService.d.ts","sourceRoot":"","sources":["../../src/scheduling/ScheduleService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,s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AO,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;YA+GE,OAAO;CA4BtB"}
|
|
@@ -96,9 +96,10 @@ function sameOwner(left, right) {
|
|
|
96
96
|
function sameCleanupOwner(left, right) {
|
|
97
97
|
return left.threadId === right.threadId && left.openId === right.openId;
|
|
98
98
|
}
|
|
99
|
-
/**
|
|
99
|
+
/** Failed future-only history is inactive; live runtimes still own admission.
|
|
100
|
+
* Other providers retain their existing native cleanup obligations. */
|
|
100
101
|
function recoveryOwnsWork(record) {
|
|
101
|
-
return !!record.recovery && (!['completed', 'cancelled'].includes(record.state)
|
|
102
|
+
return !!record.recovery && !(record.state === 'failed' && record.recovery.futureOnly) && (!['completed', 'cancelled'].includes(record.state)
|
|
102
103
|
|| !!record.error?.startsWith('Native process exit unconfirmed:'));
|
|
103
104
|
}
|
|
104
105
|
function deliveryId(scheduleId, occurrenceId) {
|
|
@@ -175,6 +176,10 @@ class ScheduleService {
|
|
|
175
176
|
const data = await this.readCatalog();
|
|
176
177
|
if (data !== undefined)
|
|
177
178
|
this.load(data);
|
|
179
|
+
// Inspect the loaded outbox before ordinary startup pruning. Missing
|
|
180
|
+
// delivery ownership must not turn a refused row into an absence claim.
|
|
181
|
+
for (const record of [...this.records.values()])
|
|
182
|
+
await this.compactRefusedCreation(record);
|
|
178
183
|
let changed = false;
|
|
179
184
|
for (const record of this.records.values()) {
|
|
180
185
|
if (['completed', 'cancelled', 'failed'].includes(record.state)) {
|
|
@@ -184,6 +189,16 @@ class ScheduleService {
|
|
|
184
189
|
}
|
|
185
190
|
continue; // Terminal tombstones always win over a stale recovery checkpoint.
|
|
186
191
|
}
|
|
192
|
+
// A consumed future-only attempt or an already blocked interrupted row
|
|
193
|
+
// cannot regain automatic admission after another service restart.
|
|
194
|
+
if (record.recovery?.futureOnly && (record.state === 'creating'
|
|
195
|
+
|| record.state === 'interrupted' && record.recovery.status === 'blocked')) {
|
|
196
|
+
record.state = 'failed';
|
|
197
|
+
record.recovery.status = 'blocked';
|
|
198
|
+
record.error ??= 'Interrupted native restoration quarantined; original session and cleanup evidence retained.';
|
|
199
|
+
changed = true;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
187
202
|
if (LIVE.has(record.state) || record.recovery?.status === 'pending'
|
|
188
203
|
|| record.state === 'interrupted' && record.recovery?.futureOnly && record.rule.kind === 'cron') {
|
|
189
204
|
const futureOnly = record.recovery?.futureOnly && record.rule.kind === 'cron';
|
|
@@ -262,6 +277,15 @@ class ScheduleService {
|
|
|
262
277
|
runtime.completed = new Set(record.completedOccurrences);
|
|
263
278
|
const controller = new AbortController();
|
|
264
279
|
runtime.recoveryAbort = controller;
|
|
280
|
+
// Admission contention has not consumed this job's clean checkpoint.
|
|
281
|
+
// Leave it pending so the exact earlier runtime can release the thread.
|
|
282
|
+
try {
|
|
283
|
+
runtime.releaseAdmission = this.options.acquireRecovery?.(structuredClone(record));
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
await this.recoveryDiagnostic(record, errorText(error));
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
265
289
|
this.runtimes.set(id, runtime);
|
|
266
290
|
const current = () => !controller.signal.aborted && !this.closing && !this.fault && !record.cancelRequested
|
|
267
291
|
&& this.current(record) && this.options.canRecover?.(structuredClone(record)) === true;
|
|
@@ -279,7 +303,6 @@ class ScheduleService {
|
|
|
279
303
|
let admitted = false;
|
|
280
304
|
let succeeded = false;
|
|
281
305
|
try {
|
|
282
|
-
runtime.releaseAdmission = this.options.acquireRecovery?.(structuredClone(record));
|
|
283
306
|
await this.serial(async () => {
|
|
284
307
|
if (!current())
|
|
285
308
|
throw new Error('Recovery admission expired.');
|
|
@@ -290,6 +313,7 @@ class ScheduleService {
|
|
|
290
313
|
await this.persist();
|
|
291
314
|
});
|
|
292
315
|
admitted = true;
|
|
316
|
+
runtime.recoveryAdmitted = true;
|
|
293
317
|
const admission = Promise.resolve().then(() => provider.reconcile(restoreRecord, { notBefore: this.now(), signal: controller.signal, isCurrent: current,
|
|
294
318
|
isOwnerCurrent: () => !record.cancelRequested && !this.fault && this.current(record),
|
|
295
319
|
canAdmitOccurrence: () => this.canAdmitOccurrence(id, runtime) }, emit));
|
|
@@ -316,12 +340,28 @@ class ScheduleService {
|
|
|
316
340
|
await this.stop(id, runtime).catch(() => { });
|
|
317
341
|
}
|
|
318
342
|
runtime.resolveReady(runtime.handle);
|
|
343
|
+
if (!runtime.handle && (error instanceof types_1.NativeScheduleRecoverySettledError
|
|
344
|
+
|| error instanceof types_1.NativeScheduleNotAdmittedError || error instanceof types_1.NativeScheduleAbsentError)) {
|
|
345
|
+
runtime.stopped = true;
|
|
346
|
+
this.releaseRecoveryAdmission(runtime);
|
|
347
|
+
if (this.runtimes.get(id) === runtime)
|
|
348
|
+
this.runtimes.delete(id);
|
|
349
|
+
}
|
|
319
350
|
// A rejection without a handle is not proof that native admission never happened.
|
|
320
351
|
throw error;
|
|
321
352
|
});
|
|
322
353
|
const handle = await Promise.race([receipt, new Promise((_, reject) => {
|
|
323
|
-
timer = setTimeout(() => {
|
|
354
|
+
timer = setTimeout(() => {
|
|
355
|
+
controller.abort();
|
|
356
|
+
reject(new Error(record.recovery?.futureOnly
|
|
357
|
+
? 'Native recovery timed out; this job will not restart automatically. Native settlement and cleanup remain separate.'
|
|
358
|
+
: 'Native recovery timed out; ownership retained, do not recreate.'));
|
|
359
|
+
}, this.options.recoveryTimeoutMs ?? 30_000);
|
|
324
360
|
})]);
|
|
361
|
+
// Native recovery and inventory validation settled. A later deadline
|
|
362
|
+
// must not abort the adopted handle while its active checkpoint is saved.
|
|
363
|
+
clearTimeout(timer);
|
|
364
|
+
timer = undefined;
|
|
325
365
|
text(handle.nativeId);
|
|
326
366
|
// The provider's reconcile contract includes inventory validation; list is
|
|
327
367
|
// additionally required to verify the returned handle before activating it.
|
|
@@ -331,6 +371,10 @@ class ScheduleService {
|
|
|
331
371
|
if (!current())
|
|
332
372
|
throw new Error('Recovery owner retired before receipt persistence.');
|
|
333
373
|
record.nativeId = handle.nativeId;
|
|
374
|
+
if (handle.recoveryIdentity) {
|
|
375
|
+
text(handle.recoveryIdentity, 8192);
|
|
376
|
+
record.recovery.identity = handle.recoveryIdentity;
|
|
377
|
+
}
|
|
334
378
|
if (record.state === 'creating')
|
|
335
379
|
record.state = 'active';
|
|
336
380
|
record.recovery.status = 'eligible';
|
|
@@ -341,12 +385,15 @@ class ScheduleService {
|
|
|
341
385
|
}
|
|
342
386
|
catch (error) {
|
|
343
387
|
controller.abort();
|
|
344
|
-
if (!admitted || error instanceof types_1.NativeScheduleAbsentError || error instanceof types_1.NativeScheduleNotAdmittedError) {
|
|
388
|
+
if (!admitted || error instanceof types_1.NativeScheduleAbsentError || error instanceof types_1.NativeScheduleNotAdmittedError || error instanceof types_1.NativeScheduleRecoverySettledError) {
|
|
345
389
|
runtime.stopped = true;
|
|
346
390
|
runtime.resolveReady(undefined);
|
|
347
391
|
}
|
|
348
392
|
// Do not retry an ambiguous mutation or release its handle on a timeout.
|
|
349
|
-
|
|
393
|
+
if (admitted)
|
|
394
|
+
await this.blockRecovery(record, errorText(error), !!record.recovery?.futureOnly);
|
|
395
|
+
else
|
|
396
|
+
await this.recoveryDiagnostic(record, errorText(error));
|
|
350
397
|
if (runtime.handle)
|
|
351
398
|
await this.stop(id, runtime).catch(() => { });
|
|
352
399
|
else if (runtime.stopped)
|
|
@@ -356,8 +403,7 @@ class ScheduleService {
|
|
|
356
403
|
if (timer)
|
|
357
404
|
clearTimeout(timer);
|
|
358
405
|
if (succeeded || runtime.stopped) {
|
|
359
|
-
|
|
360
|
-
runtime.releaseAdmission = undefined;
|
|
406
|
+
this.releaseRecoveryAdmission(runtime);
|
|
361
407
|
}
|
|
362
408
|
}
|
|
363
409
|
}
|
|
@@ -376,6 +422,20 @@ class ScheduleService {
|
|
|
376
422
|
released.add(record.threadId);
|
|
377
423
|
}
|
|
378
424
|
}
|
|
425
|
+
releaseRecoveryAdmission(runtime) {
|
|
426
|
+
const release = runtime.releaseAdmission;
|
|
427
|
+
runtime.releaseAdmission = undefined;
|
|
428
|
+
release?.();
|
|
429
|
+
if (!release || !runtime.recoveryAdmitted || !runtime.recoveryAbort?.signal.aborted)
|
|
430
|
+
return;
|
|
431
|
+
// Join the current pass before retrying untouched siblings. Failed rows are
|
|
432
|
+
// never candidates, and canRecover/acquireRecovery recheck newer admission.
|
|
433
|
+
const retry = Promise.resolve(this.recoveryRun).catch(() => { }).then(() => {
|
|
434
|
+
if (!this.closing && !this.fault && this.hasPendingRecovery())
|
|
435
|
+
return this.recover();
|
|
436
|
+
});
|
|
437
|
+
this.track(retry);
|
|
438
|
+
}
|
|
379
439
|
checkpoint(value) {
|
|
380
440
|
return { version: 1, provider: value.provider, strategy: value.strategy, identity: value.identity,
|
|
381
441
|
...(value.orderlyOnly && { orderlyOnly: true }), ...(value.futureOnly && { futureOnly: true }), ...(value.handoffPolicy && { handoffPolicy: value.handoffPolicy }), ...(value.handoff && { handoff: value.handoff }),
|
|
@@ -396,12 +456,13 @@ class ScheduleService {
|
|
|
396
456
|
text(value.identity, 8192);
|
|
397
457
|
}
|
|
398
458
|
async recoveryDiagnostic(record, reason) {
|
|
399
|
-
await this.serial(async () => { record.error = reason;
|
|
459
|
+
await this.serial(async () => { record.error = reason; if (!this.fault)
|
|
460
|
+
await this.persist(); });
|
|
400
461
|
}
|
|
401
|
-
async blockRecovery(record, reason) {
|
|
462
|
+
async blockRecovery(record, reason, quarantine = false) {
|
|
402
463
|
await this.serial(async () => {
|
|
403
464
|
if (!['completed', 'cancelled'].includes(record.state))
|
|
404
|
-
record.state = 'interrupted';
|
|
465
|
+
record.state = quarantine ? 'failed' : 'interrupted';
|
|
405
466
|
record.recovery.status = 'blocked';
|
|
406
467
|
record.error = reason;
|
|
407
468
|
if (!this.fault)
|
|
@@ -409,7 +470,19 @@ class ScheduleService {
|
|
|
409
470
|
});
|
|
410
471
|
}
|
|
411
472
|
create(owner, input) {
|
|
412
|
-
|
|
473
|
+
const creation = this.recordOperation(input.id, this.createSchedule(owner, input));
|
|
474
|
+
return this.operation(creation.catch(async (error) => {
|
|
475
|
+
if (error instanceof types_1.NativeScheduleNotAdmittedError) {
|
|
476
|
+
// The create operation has settled. Concurrent cancel/purge operations
|
|
477
|
+
// retain their own record lease and must finish before any compaction.
|
|
478
|
+
await this.serial(async () => {
|
|
479
|
+
const record = this.records.get(input.id);
|
|
480
|
+
if (record && sameOwner(record, owner))
|
|
481
|
+
await this.compactRefusedCreation(record);
|
|
482
|
+
}).catch(() => { }); // Keep the original failure receipt; persistence faults remain fenced.
|
|
483
|
+
}
|
|
484
|
+
throw error;
|
|
485
|
+
}));
|
|
413
486
|
}
|
|
414
487
|
async createSchedule(owner, input) {
|
|
415
488
|
this.checkReady();
|
|
@@ -469,6 +542,8 @@ class ScheduleService {
|
|
|
469
542
|
return Promise.reject(new Error('Native rebound owner retired.'));
|
|
470
543
|
return;
|
|
471
544
|
}
|
|
545
|
+
if (event.type === 'started' || event.type === 'completed' || event.type === 'skipped')
|
|
546
|
+
runtime.observedOccurrence = true;
|
|
472
547
|
const task = this.onEvent(nativeInput.id, structuredClone(event));
|
|
473
548
|
this.track(task);
|
|
474
549
|
return task;
|
|
@@ -511,7 +586,9 @@ class ScheduleService {
|
|
|
511
586
|
record.state = 'failed';
|
|
512
587
|
record.error = errorText(error);
|
|
513
588
|
}
|
|
514
|
-
if (error instanceof types_1.NativeScheduleNotAdmittedError && !runtime.handle && !runtime.
|
|
589
|
+
if (error instanceof types_1.NativeScheduleNotAdmittedError && !runtime.handle && !runtime.observedOccurrence
|
|
590
|
+
&& !record.nativeId && !runtime.running.size && !runtime.completed.size
|
|
591
|
+
&& !record.completedOccurrences?.length && !record.skippedOccurrences?.length) {
|
|
515
592
|
record.creationRefused = true;
|
|
516
593
|
}
|
|
517
594
|
if (!this.fault)
|
|
@@ -524,6 +601,35 @@ class ScheduleService {
|
|
|
524
601
|
throw error;
|
|
525
602
|
}
|
|
526
603
|
}
|
|
604
|
+
/** Called under the catalog serial queue, never through output-erasing purge.
|
|
605
|
+
* A refusal is proof about this fresh attempt, not historical native absence. */
|
|
606
|
+
async compactRefusedCreation(record) {
|
|
607
|
+
const id = record.id, runtime = this.runtimes.get(id);
|
|
608
|
+
if (record.state !== 'failed' || record.creationRefused !== true || record.nativeId !== undefined
|
|
609
|
+
|| record.cancelRequested || record.cleanupConfirmed || record.completedOccurrences?.length || record.skippedOccurrences?.length
|
|
610
|
+
|| this.records.get(id) !== record || this.cleanup.has(id) || this.purged.has(id)
|
|
611
|
+
|| this.fault || this.closing || this.suspending || this.hostRetirement || this.recoveryRun || this.refreshes
|
|
612
|
+
|| this.recordOperations.has(id) || this.retainedCancellations.has(id) || this.purges.has(id)
|
|
613
|
+
|| this.delivering.has(id) || [...this.pending.values()].some(item => item.scheduleId === id)
|
|
614
|
+
|| this.options.isNativeMutationPending?.(ownerOf(record))
|
|
615
|
+
|| runtime && (!runtime.stopped || runtime.handle || runtime.observedOccurrence || runtime.running.size || runtime.completed.size
|
|
616
|
+
|| runtime.heldDeliveries.size || runtime.cancelling || runtime.cancelPromise || runtime.stopPromise
|
|
617
|
+
|| runtime.recoveryAbort || runtime.releasing || runtime.releasePromise || runtime.releaseAdmission)
|
|
618
|
+
|| this.purged.size >= MAX_PURGED_IDS)
|
|
619
|
+
return;
|
|
620
|
+
this.purged.set(id, ownerOf(record));
|
|
621
|
+
this.records.delete(id);
|
|
622
|
+
try {
|
|
623
|
+
await this.persist();
|
|
624
|
+
}
|
|
625
|
+
catch (error) {
|
|
626
|
+
this.records.set(id, record);
|
|
627
|
+
this.purged.delete(id);
|
|
628
|
+
throw error;
|
|
629
|
+
}
|
|
630
|
+
if (runtime)
|
|
631
|
+
this.runtimes.delete(id);
|
|
632
|
+
}
|
|
527
633
|
/** Catalog lookup only; this does not probe or recreate native jobs. */
|
|
528
634
|
async list(owner) {
|
|
529
635
|
this.checkReady();
|
|
@@ -948,7 +1054,7 @@ class ScheduleService {
|
|
|
948
1054
|
const runtime = this.runtimes.get(id);
|
|
949
1055
|
if (record.state === 'cancelled' && runtime?.handle?.cancellationKeepsRunning && !record.error)
|
|
950
1056
|
return false;
|
|
951
|
-
return LIVE.has(record.state) || recoveryOwnsWork(record) || record.state
|
|
1057
|
+
return LIVE.has(record.state) || recoveryOwnsWork(record) || ['interrupted', 'failed'].includes(record.state) && !!record.nativeId && this.supportsRetainedCancellation(record)
|
|
952
1058
|
|| Boolean(runtime && !runtime.stopped);
|
|
953
1059
|
}
|
|
954
1060
|
/** Newly observed cleanup facts never supply historical recovery proof. The optional
|
|
@@ -973,7 +1079,7 @@ class ScheduleService {
|
|
|
973
1079
|
record.error = absent ? 'Owner-reviewed native definition absent on current host; predecessor work remains unknown.'
|
|
974
1080
|
: 'Owner-reviewed native deletion requested; absence and predecessor work remain unconfirmed.';
|
|
975
1081
|
const runtime = this.runtimes.get(id);
|
|
976
|
-
if (absent && retirementConfirmed?.() === true && (!runtime || runtime.stopped && !runtime.running.size)
|
|
1082
|
+
if (absent && retirementConfirmed?.(record) === true && (!runtime || runtime.stopped && !runtime.running.size)
|
|
977
1083
|
&& !this.recordOperations.has(id) && !this.recoveryRun && !this.refreshes && !this.retainedCancellations.has(id)) {
|
|
978
1084
|
record.state = 'cancelled';
|
|
979
1085
|
record.cleanupConfirmed = true;
|
|
@@ -1084,8 +1190,8 @@ class ScheduleService {
|
|
|
1084
1190
|
}
|
|
1085
1191
|
const retainedCleanup = !runtime || runtime.stopped && !runtime.handle?.nativeDefinitionAbsent
|
|
1086
1192
|
&& this.supportsRetainedCancellation(record);
|
|
1087
|
-
if (retainedCleanup && (recoveryOwnsWork(record)
|
|
1088
|
-
|| record.state
|
|
1193
|
+
if (retainedCleanup && (recoveryOwnsWork(record) || record.state === 'failed' && !!record.recovery
|
|
1194
|
+
|| ['interrupted', 'failed'].includes(record.state) && !!record.nativeId && this.supportsRetainedCancellation(record))) {
|
|
1089
1195
|
operation = Promise.resolve().then(() => this.cancelRetained(record));
|
|
1090
1196
|
this.retainedCancellations.set(id, operation);
|
|
1091
1197
|
return;
|
|
@@ -1166,8 +1272,8 @@ class ScheduleService {
|
|
|
1166
1272
|
}
|
|
1167
1273
|
hasUnresolvedHandoff() { return this.handoffUnresolved; }
|
|
1168
1274
|
hasUnresolvedRecovery() {
|
|
1169
|
-
return [...this.
|
|
1170
|
-
&& record.recovery?.status !== 'eligible');
|
|
1275
|
+
return [...this.runtimes.values()].some(runtime => !!runtime.recoveryAbort && !runtime.stopped && runtime.recoveryAbort.signal.aborted)
|
|
1276
|
+
|| [...this.records.values()].some(record => recoveryOwnsWork(record) && record.recovery?.status !== 'eligible');
|
|
1171
1277
|
}
|
|
1172
1278
|
hasPendingRecovery() {
|
|
1173
1279
|
return [...this.records.values()].some(record => record.state === 'interrupted' && record.recovery?.status === 'pending');
|
|
@@ -1313,7 +1419,8 @@ class ScheduleService {
|
|
|
1313
1419
|
}
|
|
1314
1420
|
/** Providers with durable intent must complete handoff before unrelated host teardown. */
|
|
1315
1421
|
requiresShutdownHandoff() {
|
|
1316
|
-
return [...this.records.values()].some(record => !!record.recovery
|
|
1422
|
+
return [...this.records.values()].some(record => !!record.recovery
|
|
1423
|
+
&& (!(record.state === 'failed' && record.recovery.futureOnly) || !!this.runtimes.get(record.id) && !this.runtimes.get(record.id).stopped));
|
|
1317
1424
|
}
|
|
1318
1425
|
destroy() {
|
|
1319
1426
|
if (this.hostRetirement && !this.hostsRetired)
|
|
@@ -1476,8 +1583,7 @@ class ScheduleService {
|
|
|
1476
1583
|
// after a failed cancellation cleanup. Never downgrade confirmed exit.
|
|
1477
1584
|
if (event.type === 'stopped' && event.exitConfirmed !== false) {
|
|
1478
1585
|
runtime.stopped = true;
|
|
1479
|
-
|
|
1480
|
-
runtime.releaseAdmission = undefined;
|
|
1586
|
+
this.releaseRecoveryAdmission(runtime);
|
|
1481
1587
|
if (record.error?.startsWith('Native process exit unconfirmed:')) {
|
|
1482
1588
|
delete record.error;
|
|
1483
1589
|
await this.persist();
|
|
@@ -1516,9 +1622,10 @@ class ScheduleService {
|
|
|
1516
1622
|
await this.persist();
|
|
1517
1623
|
return;
|
|
1518
1624
|
}
|
|
1625
|
+
const finishingFailed = record.state === 'failed' && event.type === 'completed' && runtime.running.has(event.occurrenceId);
|
|
1519
1626
|
const finishingCancelled = record.state === 'cancelled' && runtime.handle?.cancellationKeepsRunning
|
|
1520
1627
|
&& event.type === 'completed' && runtime.running.has(event.occurrenceId);
|
|
1521
|
-
if ((!finishingCancelled && record.state === 'cancelled') || record.state === 'failed' || record.state === 'completed')
|
|
1628
|
+
if ((!finishingCancelled && record.state === 'cancelled') || record.state === 'failed' && !finishingFailed || record.state === 'completed')
|
|
1522
1629
|
return;
|
|
1523
1630
|
if (event.type === 'stopped') {
|
|
1524
1631
|
if (LIVE.has(record.state)) {
|
|
@@ -1578,7 +1685,7 @@ class ScheduleService {
|
|
|
1578
1685
|
record.state = 'completed';
|
|
1579
1686
|
cleanup = true;
|
|
1580
1687
|
}
|
|
1581
|
-
else if (record.state !== 'interrupted') {
|
|
1688
|
+
else if (record.state !== 'interrupted' && record.state !== 'failed') {
|
|
1582
1689
|
record.state = runtime.running.size ? 'running' : 'active';
|
|
1583
1690
|
if (record.recovery && !runtime.running.size)
|
|
1584
1691
|
record.recovery.status = 'eligible';
|
|
@@ -1681,8 +1788,7 @@ class ScheduleService {
|
|
|
1681
1788
|
if (handle?.retirementConfirmed !== false && (!handle?.cancellationKeepsRunning || !runtime.running.size))
|
|
1682
1789
|
runtime.stopped = true;
|
|
1683
1790
|
if (runtime.stopped) {
|
|
1684
|
-
|
|
1685
|
-
runtime.releaseAdmission = undefined;
|
|
1791
|
+
this.releaseRecoveryAdmission(runtime);
|
|
1686
1792
|
await this.rememberCleanup(id, runtime);
|
|
1687
1793
|
}
|
|
1688
1794
|
}
|
|
@@ -1727,7 +1833,7 @@ class ScheduleService {
|
|
|
1727
1833
|
canAdmitOccurrence(id, runtime) {
|
|
1728
1834
|
const record = this.records.get(id);
|
|
1729
1835
|
return !!record && this.runtimes.get(id) === runtime && !this.closing && !this.hostRetirement && !this.fault
|
|
1730
|
-
&& !runtime.stopped && !runtime.cancelling && !record.cancelRequested
|
|
1836
|
+
&& !runtime.stopped && !runtime.cancelling && !runtime.recoveryAbort?.signal.aborted && !record.cancelRequested
|
|
1731
1837
|
&& LIVE.has(record.state) && this.current(record);
|
|
1732
1838
|
}
|
|
1733
1839
|
newRuntime() {
|
|
@@ -1944,8 +2050,10 @@ class ScheduleService {
|
|
|
1944
2050
|
if (entry.nativeId !== undefined)
|
|
1945
2051
|
text(entry.nativeId);
|
|
1946
2052
|
if (entry.attribution !== undefined) {
|
|
1947
|
-
const a = object(entry.attribution, ['sessionId', 'marker', 'promptHash', 'rule']);
|
|
2053
|
+
const a = object(entry.attribution, ['sessionId', 'marker', 'ownerToken', 'promptHash', 'rule']);
|
|
1948
2054
|
text(a.sessionId);
|
|
2055
|
+
if (a.ownerToken !== undefined && (entry.backend !== 'claude' || typeof a.ownerToken !== 'string' || !/^[a-f0-9-]{36}$/.test(a.ownerToken)))
|
|
2056
|
+
throw new Error('Invalid cleanup owner incarnation.');
|
|
1949
2057
|
if (typeof a.promptHash !== 'string' || !/^[a-f0-9]{64}$/.test(a.promptHash)
|
|
1950
2058
|
|| (entry.backend === 'claude' ? typeof a.marker !== 'string' || !/^[a-f0-9-]{36}$/.test(a.marker) : a.marker !== undefined))
|
|
1951
2059
|
throw new Error('Invalid cleanup attribution.');
|