@wjarka/cezarion 0.17.0-dev.3025 → 0.17.0-pr1973.3027
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/ci-wait/tools.d.ts +4 -4
- package/dist/delegation/destroy-holders.d.ts +2 -0
- package/dist/delegation/destroy-holders.js +187 -0
- package/dist/delegation/destroy-holders.js.map +1 -0
- package/dist/delegation/idle-test-app.js +58 -20
- package/dist/delegation/idle-test-app.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +3 -0
- package/dist/delegation/process-liveness.js +5 -0
- package/dist/delegation/process-liveness.js.map +1 -1
- package/dist/delegation/service.d.ts +1 -3
- package/dist/delegation/service.js +104 -24
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/windows-workspace-identity.d.ts +9 -0
- package/dist/delegation/windows-workspace-identity.js +28 -0
- package/dist/delegation/windows-workspace-identity.js.map +1 -1
- package/dist/delegation/workspace.d.ts +3 -1
- package/dist/delegation/workspace.js +307 -27
- package/dist/delegation/workspace.js.map +1 -1
- package/dist/git-worktree-release.d.ts +1 -1
- package/dist/git-worktree-release.js +2 -2
- package/dist/git-worktree-release.js.map +1 -1
- package/dist/runs/private-worker-file.d.ts +5 -0
- package/dist/runs/private-worker-file.js +51 -0
- package/dist/runs/private-worker-file.js.map +1 -0
- package/dist/runs/store.d.ts +48 -48
- package/dist/runs/store.js +47 -87
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/windows-worker-evidence.d.ts +9 -0
- package/dist/runs/windows-worker-evidence.js +71 -0
- package/dist/runs/windows-worker-evidence.js.map +1 -0
- package/dist/runs/worker-execution.js +17 -1
- package/dist/runs/worker-execution.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/server.d.ts +2121 -2121
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run.d.ts +1 -3
- package/dist/workflows/run.js +6 -7
- package/dist/workflows/run.js.map +1 -1
- package/package.json +3 -3
- package/scripts/test-fallback-sandbox.mjs +39 -0
- package/scripts/windows-workspace-identity.cs +156 -10
- package/scripts/windows-workspace-identity.ps1 +5 -0
|
@@ -61,6 +61,30 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
|
|
|
61
61
|
deadline: string;
|
|
62
62
|
seconds: number;
|
|
63
63
|
note?: string | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
id: string;
|
|
66
|
+
source: "agent" | "cezar";
|
|
67
|
+
via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
|
|
68
|
+
registeredAt: string;
|
|
69
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
70
|
+
resolvedAt?: string | undefined;
|
|
71
|
+
deliveredAt?: string | undefined;
|
|
72
|
+
cancelledAt?: string | undefined;
|
|
73
|
+
turnId: string;
|
|
74
|
+
kind: "process";
|
|
75
|
+
deadline: string;
|
|
76
|
+
timeoutSeconds: number;
|
|
77
|
+
pid: number;
|
|
78
|
+
startToken?: string | undefined;
|
|
79
|
+
exitFile?: string | undefined;
|
|
80
|
+
note?: string | undefined;
|
|
81
|
+
result?: {
|
|
82
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
83
|
+
observedAt: string;
|
|
84
|
+
exitCode?: number | undefined;
|
|
85
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
86
|
+
diagnostic?: string | undefined;
|
|
87
|
+
} | undefined;
|
|
64
88
|
} | {
|
|
65
89
|
id: string;
|
|
66
90
|
source: "agent" | "cezar";
|
|
@@ -121,30 +145,6 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
|
|
|
121
145
|
reason: "outcome" | "timeout";
|
|
122
146
|
} | undefined;
|
|
123
147
|
wakeInputId?: string | undefined;
|
|
124
|
-
} | {
|
|
125
|
-
id: string;
|
|
126
|
-
source: "agent" | "cezar";
|
|
127
|
-
via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
|
|
128
|
-
registeredAt: string;
|
|
129
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
130
|
-
resolvedAt?: string | undefined;
|
|
131
|
-
deliveredAt?: string | undefined;
|
|
132
|
-
cancelledAt?: string | undefined;
|
|
133
|
-
turnId: string;
|
|
134
|
-
kind: "process";
|
|
135
|
-
deadline: string;
|
|
136
|
-
timeoutSeconds: number;
|
|
137
|
-
pid: number;
|
|
138
|
-
startToken?: string | undefined;
|
|
139
|
-
exitFile?: string | undefined;
|
|
140
|
-
note?: string | undefined;
|
|
141
|
-
result?: {
|
|
142
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
143
|
-
observedAt: string;
|
|
144
|
-
exitCode?: number | undefined;
|
|
145
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
146
|
-
diagnostic?: string | undefined;
|
|
147
|
-
} | undefined;
|
|
148
148
|
})[];
|
|
149
149
|
resumes: boolean;
|
|
150
150
|
owedBefore: boolean;
|
package/dist/workflows/run.d.ts
CHANGED
|
@@ -400,9 +400,7 @@ export declare class RunManager {
|
|
|
400
400
|
* dead leader's group counts only while a process holding `paths` is in it. Every signal
|
|
401
401
|
* re-verifies first: a reused PID or group number is never touched. */
|
|
402
402
|
private terminateRecorded;
|
|
403
|
-
/** Destroy
|
|
404
|
-
* agent left in its process group holds the worktree, and nothing else ties it to the worker.
|
|
405
|
-
* A record whose controller is another live cezar is not ours to act on. */
|
|
403
|
+
/** Destroy recorded survivors, excluding a foreign live controller (hearsay-tools/cezarion#890). */
|
|
406
404
|
private terminateFinishedWorkerGroups;
|
|
407
405
|
/** Best effort: a failed write leaves the working-directory scan as this process's evidence. */
|
|
408
406
|
private recordWorkerProcess;
|
package/dist/workflows/run.js
CHANGED
|
@@ -31,7 +31,7 @@ import { ProcessWaitSupervisor, probeProcessWait } from '../process-wait/supervi
|
|
|
31
31
|
import { confineExitFile } from '../process-wait/exit-file.js';
|
|
32
32
|
import { WorkerScratchCleanup } from '../delegation/scratch-cleanup.js';
|
|
33
33
|
import { noJitter, ORPHAN_BACKOFF, retryDelayMs, WAKE_RETRY_BACKOFF } from '../delegation/retry-backoff.js';
|
|
34
|
-
import { inspectExecutionGeneration, isCurrentProcess, processesWithCwdUnder, processStartToken, recordedGroupSignalable, recordedProcessLive, sharedCwdScan } from '../delegation/process-liveness.js';
|
|
34
|
+
import { inspectExecutionGeneration, isCurrentProcess, processesWithCwdUnder, processStartToken, recordedGroupSignalable, recordedProcessLive, sameDestroyGeneration, sharedCwdScan } from '../delegation/process-liveness.js';
|
|
35
35
|
import { parseUsageLimit } from '../core/usage-limit.js';
|
|
36
36
|
import { startManagedSession } from '../core/managed-session.js';
|
|
37
37
|
import { createRunner } from '../core/runner-factory.js';
|
|
@@ -966,9 +966,7 @@ export class RunManager {
|
|
|
966
966
|
if (living())
|
|
967
967
|
signal('SIGKILL');
|
|
968
968
|
}
|
|
969
|
-
/** Destroy
|
|
970
|
-
* agent left in its process group holds the worktree, and nothing else ties it to the worker.
|
|
971
|
-
* A record whose controller is another live cezar is not ours to act on. */
|
|
969
|
+
/** Destroy recorded survivors, excluding a foreign live controller (hearsay-tools/cezarion#890). */
|
|
972
970
|
async terminateFinishedWorkerGroups(runId, timeoutMs) {
|
|
973
971
|
const proof = this.store.readWorkerExecution(runId);
|
|
974
972
|
if (proof?.phase !== 'complete')
|
|
@@ -979,12 +977,13 @@ export class RunManager {
|
|
|
979
977
|
(recordedProcessLive(record.controller) && !isCurrentProcess(record.controller)))
|
|
980
978
|
return;
|
|
981
979
|
const groups = record.processes.filter(entry => entry.pgid !== undefined);
|
|
982
|
-
|
|
980
|
+
const pids = record.processes.filter(entry => entry.pgid === undefined && entry.startToken !== undefined && recordedProcessLive(entry));
|
|
981
|
+
if (!groups.length && !pids.length)
|
|
983
982
|
return;
|
|
984
983
|
const deadline = Date.now() + Math.min(30_000, Math.max(0, Number.isFinite(timeoutMs) ? timeoutMs : 0));
|
|
985
984
|
const pause = () => new Promise(resolve => setTimeout(resolve, Math.max(0, Math.min(100, deadline - Date.now()))));
|
|
986
|
-
const
|
|
987
|
-
await this.terminateRecorded({ pids
|
|
985
|
+
const workspace = run.delegation.workspace, requestedAt = run.delegation.destroy?.requestedAt, paths = [workspace.path, ...agentTmpDirLocationEvidence(this.dataDir, runId).paths];
|
|
986
|
+
await this.terminateRecorded({ pids, groups, paths }, deadline, pause, () => !this.disposed && sameDestroyGeneration(this.store.getRun(runId), this.store.readWorkerExecution(runId)?.generation, proof.generation, workspace, requestedAt));
|
|
988
987
|
}
|
|
989
988
|
/** Best effort: a failed write leaves the working-directory scan as this process's evidence. */
|
|
990
989
|
recordWorkerProcess(runId, pid) {
|