@claudexor/daemon 3.3.16 → 3.4.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/dist/command-store.d.ts +3 -0
- package/dist/command-store.d.ts.map +1 -1
- package/dist/command-store.js +4 -0
- package/dist/command-store.js.map +1 -1
- package/dist/daemon-listen.d.ts +10 -0
- package/dist/daemon-listen.d.ts.map +1 -0
- package/dist/daemon-listen.js +36 -0
- package/dist/daemon-listen.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interactions.d.ts +3 -0
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +4 -0
- package/dist/interactions.js.map +1 -1
- package/dist/journal-manager-lifecycle.d.ts +8 -0
- package/dist/journal-manager-lifecycle.d.ts.map +1 -0
- package/dist/journal-manager-lifecycle.js +2 -0
- package/dist/journal-manager-lifecycle.js.map +1 -0
- package/dist/journal-manager.d.ts +21 -11
- package/dist/journal-manager.d.ts.map +1 -1
- package/dist/journal-manager.js +234 -198
- package/dist/journal-manager.js.map +1 -1
- package/dist/journal-prepared-operation.d.ts +53 -0
- package/dist/journal-prepared-operation.d.ts.map +1 -0
- package/dist/journal-prepared-operation.js +158 -0
- package/dist/journal-prepared-operation.js.map +1 -0
- package/dist/journal-projection-slot.d.ts +28 -0
- package/dist/journal-projection-slot.d.ts.map +1 -0
- package/dist/journal-projection-slot.js +71 -0
- package/dist/journal-projection-slot.js.map +1 -0
- package/dist/journal-projection.d.ts +2 -0
- package/dist/journal-projection.d.ts.map +1 -1
- package/dist/journal-recovery-files.d.ts +19 -1
- package/dist/journal-recovery-files.d.ts.map +1 -1
- package/dist/journal-recovery-files.js +271 -26
- package/dist/journal-recovery-files.js.map +1 -1
- package/dist/journal-recovery-operation.d.ts +27 -0
- package/dist/journal-recovery-operation.d.ts.map +1 -0
- package/dist/journal-recovery-operation.js +68 -0
- package/dist/journal-recovery-operation.js.map +1 -0
- package/dist/project-partition-preparation.d.ts +75 -0
- package/dist/project-partition-preparation.d.ts.map +1 -0
- package/dist/project-partition-preparation.js +233 -0
- package/dist/project-partition-preparation.js.map +1 -0
- package/dist/project-partitions.d.ts +18 -16
- package/dist/project-partitions.d.ts.map +1 -1
- package/dist/project-partitions.js +98 -99
- package/dist/project-partitions.js.map +1 -1
- package/dist/project-thread-listing.d.ts +14 -0
- package/dist/project-thread-listing.d.ts.map +1 -0
- package/dist/project-thread-listing.js +37 -0
- package/dist/project-thread-listing.js.map +1 -0
- package/dist/quota-projection.d.ts +9 -0
- package/dist/quota-projection.d.ts.map +1 -0
- package/dist/quota-projection.js +10 -0
- package/dist/quota-projection.js.map +1 -0
- package/dist/quota-registry.d.ts +3 -5
- package/dist/quota-registry.d.ts.map +1 -1
- package/dist/quota-registry.js +9 -10
- package/dist/quota-registry.js.map +1 -1
- package/dist/root-authority.d.ts +68 -0
- package/dist/root-authority.d.ts.map +1 -0
- package/dist/root-authority.js +380 -0
- package/dist/root-authority.js.map +1 -0
- package/dist/rpc-followers.d.ts +17 -0
- package/dist/rpc-followers.d.ts.map +1 -0
- package/dist/rpc-followers.js +46 -0
- package/dist/rpc-followers.js.map +1 -0
- package/dist/server.d.ts +4 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -62
- package/dist/server.js.map +1 -1
- package/dist/serving-admission.d.ts +21 -0
- package/dist/serving-admission.d.ts.map +1 -0
- package/dist/serving-admission.js +17 -0
- package/dist/serving-admission.js.map +1 -0
- package/dist/terminate.d.ts +18 -7
- package/dist/terminate.d.ts.map +1 -1
- package/dist/terminate.js +213 -69
- package/dist/terminate.js.map +1 -1
- package/dist/token.d.ts +6 -0
- package/dist/token.d.ts.map +1 -1
- package/dist/token.js +8 -0
- package/dist/token.js.map +1 -1
- package/dist/writer-lease.d.ts +76 -4
- package/dist/writer-lease.d.ts.map +1 -1
- package/dist/writer-lease.js +346 -56
- package/dist/writer-lease.js.map +1 -1
- package/package.json +5 -5
package/dist/terminate.js
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
1
|
import { compareProcessIdentity, defaultProcessIdentityService, } from "@claudexor/core";
|
|
2
|
-
import {
|
|
2
|
+
import { classifyDaemonLeaseOwner, inspectDaemonWriterLease, processIsAlive, } from "./writer-lease.js";
|
|
3
|
+
const DEFAULT_LEASE_AUTHORITY = {
|
|
4
|
+
inspect: (socketPath) => inspectDaemonWriterLease(socketPath),
|
|
5
|
+
classify: (owner) => classifyDaemonLeaseOwner(owner),
|
|
6
|
+
};
|
|
7
|
+
function compatibilityObservation(identity) {
|
|
8
|
+
return { identity, linuxState: null };
|
|
9
|
+
}
|
|
10
|
+
function compatibilityUnknownObservation(owner) {
|
|
11
|
+
return compatibilityObservation({
|
|
12
|
+
status: "unknown",
|
|
13
|
+
pid: owner.pid,
|
|
14
|
+
platform: process.platform,
|
|
15
|
+
reason: "unsupported_platform",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function classifyCompatibilityIdentity(owner, identity) {
|
|
19
|
+
if (!owner.identity) {
|
|
20
|
+
return {
|
|
21
|
+
status: "capable",
|
|
22
|
+
reason: "legacy_process_present",
|
|
23
|
+
observation: compatibilityUnknownObservation(owner),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const observed = identity.read(owner.pid);
|
|
27
|
+
const observation = compatibilityObservation(observed);
|
|
28
|
+
if (observed.status === "missing") {
|
|
29
|
+
return { status: "proven_stale", reason: "process_missing", observation };
|
|
30
|
+
}
|
|
31
|
+
if (observed.status === "known") {
|
|
32
|
+
return compareProcessIdentity(owner.identity, observed) === "same"
|
|
33
|
+
? { status: "capable", reason: "identity_match", observation }
|
|
34
|
+
: { status: "proven_stale", reason: "identity_mismatch", observation };
|
|
35
|
+
}
|
|
36
|
+
return { status: "unknown", reason: "identity_unavailable", observation };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Patch-compatible dependency adapter for callers that supplied the old
|
|
40
|
+
* identity/isAlive test seams. It is unreachable from normal production and
|
|
41
|
+
* from the explicit strict fourth-argument authority. Filesystem inspection
|
|
42
|
+
* remains strict; only a valid owner's injected process capability follows the
|
|
43
|
+
* old isAlive-before-identity order. The shared termination loop still owns
|
|
44
|
+
* target pinning, successor refusal, and explicit-owner-only signal authority.
|
|
45
|
+
*/
|
|
46
|
+
function createCompatibilityLeaseAuthority(identity, isAlive) {
|
|
47
|
+
const classify = (owner) => {
|
|
48
|
+
if (!isAlive(owner.pid)) {
|
|
49
|
+
return {
|
|
50
|
+
status: "proven_stale",
|
|
51
|
+
reason: "process_missing",
|
|
52
|
+
observation: compatibilityObservation({
|
|
53
|
+
status: "missing",
|
|
54
|
+
pid: owner.pid,
|
|
55
|
+
platform: process.platform,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return classifyCompatibilityIdentity(owner, identity);
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
inspect: (socketPath) => {
|
|
63
|
+
const current = inspectDaemonWriterLease(socketPath);
|
|
64
|
+
return current.status === "owned"
|
|
65
|
+
? {
|
|
66
|
+
...current,
|
|
67
|
+
// Inspection proves only that a valid record is present. The
|
|
68
|
+
// shared loop classifies the pinned target exactly once; this
|
|
69
|
+
// placeholder also preserves old successor refusal semantics.
|
|
70
|
+
capability: {
|
|
71
|
+
status: "capable",
|
|
72
|
+
reason: "legacy_process_present",
|
|
73
|
+
observation: compatibilityUnknownObservation(current.owner),
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
: current;
|
|
77
|
+
},
|
|
78
|
+
classify,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function sameOwner(left, right) {
|
|
82
|
+
return left.pid === right.pid && left.token === right.token;
|
|
83
|
+
}
|
|
84
|
+
function staleOwnerDetail(owner, capability) {
|
|
85
|
+
if (capability.status !== "proven_stale")
|
|
86
|
+
return `daemon pid ${owner.pid} exited`;
|
|
87
|
+
switch (capability.reason) {
|
|
88
|
+
case "process_missing":
|
|
89
|
+
return `daemon pid ${owner.pid} is gone`;
|
|
90
|
+
case "identity_mismatch":
|
|
91
|
+
return `pid ${owner.pid} was recycled by another process (never signalled)`;
|
|
92
|
+
case "linux_zombie":
|
|
93
|
+
return `daemon pid ${owner.pid} is a Linux zombie (never signalled)`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function staleOwnerOutcome(owner, capability, current, requireNoSuccessor, killed) {
|
|
97
|
+
const successor = current.status === "owned" && !sameOwner(current.owner, owner) ? current : null;
|
|
98
|
+
if (requireNoSuccessor) {
|
|
99
|
+
if (current.status === "unknown") {
|
|
100
|
+
return {
|
|
101
|
+
outcome: "still_alive",
|
|
102
|
+
detail: `daemon pid ${owner.pid} exited but writer-lease activity is unknown (${current.reason})`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (successor && successor.capability.status !== "proven_stale") {
|
|
106
|
+
return {
|
|
107
|
+
outcome: "still_alive",
|
|
108
|
+
detail: `daemon pid ${owner.pid} exited but successor pid ${successor.owner.pid} owns the writer lease`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const successorDetail = successor
|
|
113
|
+
? ` (writer lease now records stale pid ${successor.owner.pid})`
|
|
114
|
+
: "";
|
|
115
|
+
return {
|
|
116
|
+
outcome: killed ? "killed" : "exited",
|
|
117
|
+
detail: `${staleOwnerDetail(owner, capability)}${successorDetail}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
3
120
|
/**
|
|
4
121
|
* Await the CONFIRMED death of the daemon owning `socketPath`'s writer lease
|
|
5
122
|
* (W3.5): "stop requested" is not "stopped" — a disposer that removes state
|
|
@@ -12,77 +129,84 @@ import { daemonLeaseOwner, processIsAlive } from "./writer-lease.js";
|
|
|
12
129
|
* window (the app auto-starts one) could be waited on — and SIGKILLed — in
|
|
13
130
|
* place of the process we were asked to stop.
|
|
14
131
|
*
|
|
15
|
-
* Confirmed death = the pinned owner
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
132
|
+
* Confirmed death = the pinned owner released its lease, or the canonical
|
|
133
|
+
* classifier proves its pid missing, recycled, or a Linux zombie. A takeover
|
|
134
|
+
* alone does not prove that the old owner exited. Past the graceful window a
|
|
135
|
+
* SIGKILL is sent ONLY when an explicitly supplied pinned birth identity still
|
|
136
|
+
* matches the process in that same iteration; without that proof this fails
|
|
137
|
+
* closed to an honest `still_alive`.
|
|
20
138
|
*/
|
|
21
|
-
export async function awaitDaemonTermination(socketPath, options = {}, deps = {}) {
|
|
139
|
+
export async function awaitDaemonTermination(socketPath, options = {}, deps = {}, leaseAuthority) {
|
|
22
140
|
const deadlineMs = options.deadlineMs ?? 20_000;
|
|
23
141
|
const killAfterMs = options.killAfterMs ?? 17_000;
|
|
24
142
|
const allowSigkill = options.allowSigkill ?? false;
|
|
25
143
|
const pollMs = options.pollMs ?? 150;
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
144
|
+
// Legacy execution dependencies retain their one-read accessor behavior.
|
|
145
|
+
const configuredKill = deps.kill;
|
|
146
|
+
const configuredSleep = deps.sleep;
|
|
147
|
+
const configuredNow = deps.now;
|
|
148
|
+
const kill = configuredKill ?? ((pid, signal) => process.kill(pid, signal));
|
|
149
|
+
const sleep = configuredSleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
150
|
+
const now = configuredNow ?? Date.now;
|
|
151
|
+
let authority;
|
|
152
|
+
let classifySignalTarget;
|
|
153
|
+
if (leaseAuthority) {
|
|
154
|
+
authority = leaseAuthority;
|
|
155
|
+
classifySignalTarget = (owner) => leaseAuthority.classify(owner);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Do not even inspect the old policy getters when an explicit fourth
|
|
159
|
+
// authority is present. Without one, capture each exactly once and enable
|
|
160
|
+
// compatibility only when the caller actually supplied that seam.
|
|
161
|
+
const configuredIdentity = deps.identity;
|
|
162
|
+
const configuredIsAlive = deps.isAlive;
|
|
163
|
+
if (configuredIdentity !== undefined || configuredIsAlive !== undefined) {
|
|
164
|
+
const identity = configuredIdentity ?? defaultProcessIdentityService;
|
|
165
|
+
authority = createCompatibilityLeaseAuthority(identity, configuredIsAlive ?? processIsAlive);
|
|
166
|
+
classifySignalTarget = (owner) => classifyCompatibilityIdentity(owner, identity);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
authority = DEFAULT_LEASE_AUTHORITY;
|
|
170
|
+
classifySignalTarget = (owner) => DEFAULT_LEASE_AUTHORITY.classify(owner);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
31
173
|
const start = now();
|
|
32
174
|
let killed = false;
|
|
33
175
|
let noKillReason = null;
|
|
176
|
+
let current = authority.inspect(socketPath);
|
|
34
177
|
// The ONE owner this call is about. Everything below judges the world
|
|
35
178
|
// against this snapshot — never against whoever holds the lease later.
|
|
36
|
-
|
|
37
|
-
if (!owner)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
179
|
+
let owner = options.expectedOwner;
|
|
180
|
+
if (!owner) {
|
|
181
|
+
if (current.status === "absent") {
|
|
182
|
+
return { outcome: "exited", detail: "no daemon owns the writer lease" };
|
|
183
|
+
}
|
|
184
|
+
if (current.status === "unknown") {
|
|
42
185
|
return {
|
|
43
|
-
outcome:
|
|
44
|
-
detail:
|
|
186
|
+
outcome: "still_alive",
|
|
187
|
+
detail: `daemon activity is unknown (${current.reason})`,
|
|
45
188
|
};
|
|
46
189
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// that, and never touch the newcomer.
|
|
50
|
-
if (current.token !== owner.token || current.pid !== owner.pid) {
|
|
51
|
-
// Takeover proves OWNERSHIP changed, not that the old daemon died
|
|
52
|
-
// (release wave tier1 #2): confirm the pinned pid is actually gone
|
|
53
|
-
// before reporting exit; a still-alive old process keeps this loop
|
|
54
|
-
// (and its escalation) on the case.
|
|
55
|
-
if (!isAlive(owner.pid)) {
|
|
56
|
-
if (options.requireNoSuccessor) {
|
|
57
|
-
return {
|
|
58
|
-
outcome: "still_alive",
|
|
59
|
-
detail: `daemon pid ${owner.pid} exited but successor pid ${current.pid} owns the writer lease`,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
outcome: killed ? "killed" : "exited",
|
|
64
|
-
detail: `daemon pid ${owner.pid} released its lease (now held by pid ${current.pid})`,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
190
|
+
if (current.capability.status === "proven_stale") {
|
|
191
|
+
return { outcome: "exited", detail: staleOwnerDetail(current.owner, current.capability) };
|
|
67
192
|
}
|
|
68
|
-
|
|
193
|
+
owner = current.owner;
|
|
194
|
+
}
|
|
195
|
+
const explicitOwner = options.expectedOwner !== undefined;
|
|
196
|
+
for (;;) {
|
|
197
|
+
if (current.status === "absent") {
|
|
69
198
|
return {
|
|
70
199
|
outcome: killed ? "killed" : "exited",
|
|
71
|
-
detail:
|
|
200
|
+
detail: killed ? "daemon exited after SIGKILL escalation" : "daemon released its lease",
|
|
72
201
|
};
|
|
73
202
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
outcome: "exited",
|
|
83
|
-
detail: `pid ${owner.pid} was recycled by another process (never signalled)`,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
203
|
+
// The current lease record may have the same pid/token but different
|
|
204
|
+
// identity bytes. Classify the immutable pinned target itself every time;
|
|
205
|
+
// a current record's capability may describe only a successor/current
|
|
206
|
+
// generation and can never lend signal authority to the target.
|
|
207
|
+
const targetCapability = authority.classify(owner);
|
|
208
|
+
if (targetCapability.status === "proven_stale") {
|
|
209
|
+
return staleOwnerOutcome(owner, targetCapability, current, options.requireNoSuccessor, killed);
|
|
86
210
|
}
|
|
87
211
|
const elapsed = now() - start;
|
|
88
212
|
if (elapsed >= deadlineMs) {
|
|
@@ -97,27 +221,47 @@ export async function awaitDaemonTermination(socketPath, options = {}, deps = {}
|
|
|
97
221
|
if (!killed && elapsed >= killAfterMs) {
|
|
98
222
|
if (!allowSigkill) {
|
|
99
223
|
noKillReason = `daemon pid ${owner.pid} is still alive; SIGKILL withheld (caller has no signal authority)`;
|
|
100
|
-
await sleep(pollMs);
|
|
101
|
-
continue;
|
|
102
224
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
/* delivery raced its exit; the next poll observes the truth */
|
|
114
|
-
}
|
|
225
|
+
else if (!explicitOwner) {
|
|
226
|
+
noKillReason = `daemon pid ${owner.pid} is still alive; SIGKILL withheld (no explicit expected owner)`;
|
|
227
|
+
}
|
|
228
|
+
else if (current.status === "unknown") {
|
|
229
|
+
noKillReason = `daemon pid ${owner.pid} is still alive; SIGKILL withheld (writer-lease authority unknown)`;
|
|
230
|
+
}
|
|
231
|
+
else if (!owner.identity) {
|
|
232
|
+
noKillReason = `daemon pid ${owner.pid} is still alive; SIGKILL withheld (no recorded birth identity)`;
|
|
115
233
|
}
|
|
116
234
|
else {
|
|
117
|
-
|
|
235
|
+
// Time and injected dependencies may advance between the loop's exit
|
|
236
|
+
// classification and this escalation point. Only a second proof made
|
|
237
|
+
// immediately before delivery can authorize a signal.
|
|
238
|
+
const signalCapability = classifySignalTarget(owner);
|
|
239
|
+
if (signalCapability.status === "proven_stale") {
|
|
240
|
+
// Runtime replacement must also refuse a successor that appeared
|
|
241
|
+
// during the pre-signal identity recheck. The loop's `current`
|
|
242
|
+
// snapshot predates `now()` and this second classification, so it
|
|
243
|
+
// cannot prove the no-successor condition at this return boundary.
|
|
244
|
+
// Other callers preserve their existing inspection/call counts.
|
|
245
|
+
const requireNoSuccessor = options.requireNoSuccessor;
|
|
246
|
+
const exitCurrent = requireNoSuccessor ? authority.inspect(socketPath) : current;
|
|
247
|
+
return staleOwnerOutcome(owner, signalCapability, exitCurrent, requireNoSuccessor, killed);
|
|
248
|
+
}
|
|
249
|
+
if (signalCapability.status === "capable" && signalCapability.reason === "identity_match") {
|
|
250
|
+
try {
|
|
251
|
+
kill(owner.pid, "SIGKILL");
|
|
252
|
+
killed = true;
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
/* delivery raced its exit; the next poll observes the truth */
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
noKillReason = `daemon pid ${owner.pid} is still alive; SIGKILL withheld (identity unverifiable)`;
|
|
260
|
+
}
|
|
118
261
|
}
|
|
119
262
|
}
|
|
120
263
|
await sleep(pollMs);
|
|
264
|
+
current = authority.inspect(socketPath);
|
|
121
265
|
}
|
|
122
266
|
}
|
|
123
267
|
//# sourceMappingURL=terminate.js.map
|
package/dist/terminate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminate.js","sourceRoot":"","sources":["../src/terminate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"terminate.js","sourceRoot":"","sources":["../src/terminate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,6BAA6B,GAI9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,GAIf,MAAM,mBAAmB,CAAC;AAmD3B,MAAM,uBAAuB,GAAoC;IAC/D,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,wBAAwB,CAAC,UAAU,CAAC;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC;CACrD,CAAC;AAEF,SAAS,wBAAwB,CAAC,QAAyB;IACzD,OAA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,MAAM,GAAG,IAAI,CAAC;oBAChB,CAAC;oBAAC,MAAM,CAAC;wBACP,+DAA+D;oBACjE,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,YAAY,GAAG,cAAc,KAAK,CAAC,GAAG,2DAA2D,CAAC;gBACpG,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
package/dist/token.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ export declare function ensureDaemonRuntimeRoot(): string;
|
|
|
13
13
|
* D30 shape) get distinct endpoints, exactly like distinct socket files do.
|
|
14
14
|
*/
|
|
15
15
|
export declare function defaultSocketPath(platform?: NodeJS.Platform): string;
|
|
16
|
+
/** The data root's canonical default endpoint, ignoring any socket-spelling
|
|
17
|
+
* override. The issue #165 root-authority barrier anchors HERE (D4): authority
|
|
18
|
+
* follows the data root, so runtimes with custom socket spellings still share
|
|
19
|
+
* one root authority, and the legacy barrier stays at the address pre-fix
|
|
20
|
+
* runtimes contend on. */
|
|
21
|
+
export declare function canonicalDefaultSocketPath(platform?: NodeJS.Platform): string;
|
|
16
22
|
/** Whether a control endpoint is a Windows named pipe rather than a socket FILE. */
|
|
17
23
|
export declare function isWindowsPipePath(path: string): boolean;
|
|
18
24
|
export declare function logPath(): string;
|
package/dist/token.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAyBA,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAyBA,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAItF;AAED;;;;0BAI0B;AAC1B,wBAAgB,0BAA0B,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAQ/F;AAED,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,gFAAgF;AAChF,wBAAgB,WAAW,IAAI,MAAM,CAgCpC;AAED,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAOzC;AAsBD;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAgCpC"}
|
package/dist/token.js
CHANGED
|
@@ -33,6 +33,14 @@ export function defaultSocketPath(platform = process.platform) {
|
|
|
33
33
|
const override = process.env.CLAUDEXOR_DAEMON_SOCK;
|
|
34
34
|
if (override)
|
|
35
35
|
return override;
|
|
36
|
+
return canonicalDefaultSocketPath(platform);
|
|
37
|
+
}
|
|
38
|
+
/** The data root's canonical default endpoint, ignoring any socket-spelling
|
|
39
|
+
* override. The issue #165 root-authority barrier anchors HERE (D4): authority
|
|
40
|
+
* follows the data root, so runtimes with custom socket spellings still share
|
|
41
|
+
* one root authority, and the legacy barrier stays at the address pre-fix
|
|
42
|
+
* runtimes contend on. */
|
|
43
|
+
export function canonicalDefaultSocketPath(platform = process.platform) {
|
|
36
44
|
if (platform === "win32") {
|
|
37
45
|
const digest = sha256(resolve(daemonDir()))
|
|
38
46
|
.replace(/^sha256:/, "")
|
package/dist/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../src/token.ts"],"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C;YACtB,SAAS,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;YAAS,CAAC;QACT,IAAI,EAAE,KAAK,SAAS;YAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
package/dist/writer-lease.d.ts
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
2
|
+
import { type KnownProcessIdentity, type ProcessIdentityReader, type ProcessObservation, type ProcessObservationReader } from "@claudexor/core";
|
|
3
|
+
/** Marker file whose presence turns a lease directory into the permanent
|
|
4
|
+
* root-authority barrier (issue #165 D1). The barrier directory deliberately
|
|
5
|
+
* carries NO top-level owner.json: a pre-fix claimant's lease parse fails
|
|
6
|
+
* closed on it forever, so it can never quarantine the barrier and take over
|
|
7
|
+
* a data root last served by a fixed runtime. */
|
|
8
|
+
export declare const ROOT_AUTHORITY_MARKER_FILE = "root-authority-v2.json";
|
|
2
9
|
/**
|
|
3
|
-
* Filesystem
|
|
10
|
+
* Filesystem anchor of the single-writer lease for a control endpoint. A Unix
|
|
4
11
|
* socket FILE anchors its lease right next to itself; a named pipe is not a
|
|
5
12
|
* filesystem entry (nothing can be created in `\\.\pipe\`), so its lease lives
|
|
6
13
|
* in the daemon dir under the pipe's own final segment — which already carries
|
|
7
14
|
* the config-dir digest, keeping concurrent daemons' leases distinct.
|
|
8
15
|
*/
|
|
16
|
+
export declare function writerLeaseAnchorPath(socketPath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Effective single-writer lease address. Once the anchor directory carries the
|
|
19
|
+
* permanent root-authority barrier marker (issue #165 D1/D4), the live claim
|
|
20
|
+
* for every FIXED runtime moves to the nested `active.writer` slot inside the
|
|
21
|
+
* barrier, so inspection, acquisition, termination and operator stop all keep
|
|
22
|
+
* following one canonical address. Pre-fix runtimes never resolve the nested
|
|
23
|
+
* slot — they contend on the anchor itself, where the opaque barrier refuses
|
|
24
|
+
* them. Without a marker the anchor stays the (legacy-compatible) address.
|
|
25
|
+
*/
|
|
9
26
|
export declare function writerLeasePath(socketPath: string): string;
|
|
10
27
|
export interface DaemonWriterLease {
|
|
11
28
|
readonly path: string;
|
|
@@ -23,11 +40,66 @@ export interface DaemonLeaseOwner {
|
|
|
23
40
|
* Absent on legacy leases or when the platform cannot observe identity. */
|
|
24
41
|
identity?: KnownProcessIdentity;
|
|
25
42
|
}
|
|
43
|
+
export type DaemonLeaseOwnerCapability = {
|
|
44
|
+
status: "capable";
|
|
45
|
+
reason: "identity_match" | "legacy_process_present";
|
|
46
|
+
observation: ProcessObservation;
|
|
47
|
+
} | {
|
|
48
|
+
status: "proven_stale";
|
|
49
|
+
reason: "process_missing" | "identity_mismatch" | "linux_zombie";
|
|
50
|
+
observation: ProcessObservation;
|
|
51
|
+
} | {
|
|
52
|
+
status: "unknown";
|
|
53
|
+
reason: "identity_unavailable" | "presence_unknown";
|
|
54
|
+
observation: ProcessObservation;
|
|
55
|
+
};
|
|
56
|
+
export type DaemonWriterLeaseUnknownReason = "lease_unreadable" | "lease_unstable" | "invalid_lease_path" | "owner_missing" | "owner_unreadable" | "owner_malformed";
|
|
57
|
+
export type DaemonWriterLeaseStatus = {
|
|
58
|
+
status: "absent";
|
|
59
|
+
path: string;
|
|
60
|
+
} | {
|
|
61
|
+
status: "owned";
|
|
62
|
+
path: string;
|
|
63
|
+
owner: DaemonLeaseOwner;
|
|
64
|
+
capability: DaemonLeaseOwnerCapability;
|
|
65
|
+
} | {
|
|
66
|
+
status: "unknown";
|
|
67
|
+
path: string;
|
|
68
|
+
reason: DaemonWriterLeaseUnknownReason;
|
|
69
|
+
};
|
|
70
|
+
/** Narrow synchronous seam used to deterministically exercise failure/race branches. */
|
|
71
|
+
export interface DaemonWriterLeaseFilesystem {
|
|
72
|
+
lstat(path: string): Stats;
|
|
73
|
+
readText(path: string): string;
|
|
74
|
+
createLeaseDirectory(path: string): void;
|
|
75
|
+
writeOwner(path: string, data: string): void;
|
|
76
|
+
rename(from: string, to: string): void;
|
|
77
|
+
remove(path: string): void;
|
|
78
|
+
}
|
|
79
|
+
export interface DaemonWriterLeaseDependencies {
|
|
80
|
+
identity?: ProcessIdentityReader;
|
|
81
|
+
/** Explicit observation capability; never inferred from an identity reader by property name. */
|
|
82
|
+
observation?: ProcessObservationReader;
|
|
83
|
+
/** Signal-zero probe: return for present, throw an errno-bearing error otherwise. */
|
|
84
|
+
probeProcess?: (pid: number) => void;
|
|
85
|
+
filesystem?: Partial<DaemonWriterLeaseFilesystem>;
|
|
86
|
+
}
|
|
87
|
+
/** Resolved filesystem seam. The root-authority in-place migration (C4)
|
|
88
|
+
* shares it so its atomic steps stay deterministically observable in tests. */
|
|
89
|
+
export declare function resolveWriterLeaseFilesystem(deps: DaemonWriterLeaseDependencies): DaemonWriterLeaseFilesystem;
|
|
90
|
+
export declare function classifyDaemonLeaseOwner(owner: DaemonLeaseOwner, deps?: DaemonWriterLeaseDependencies): DaemonLeaseOwnerCapability;
|
|
91
|
+
/** Strict authority read: only a physically missing lease path is `absent`. */
|
|
92
|
+
export declare function inspectDaemonWriterLease(socketPath: string, deps?: DaemonWriterLeaseDependencies): DaemonWriterLeaseStatus;
|
|
93
|
+
export declare function writerLeaseTombstonePath(leasePath: string, owner: DaemonLeaseOwner): string;
|
|
26
94
|
/** Claim single-writer authority before any daemon journal is opened. */
|
|
27
95
|
export declare function acquireDaemonWriterLease(socketPath: string, deps?: {
|
|
28
96
|
identity?: ProcessIdentityReader;
|
|
29
|
-
}): DaemonWriterLease;
|
|
30
|
-
/**
|
|
97
|
+
}, acquisitionDeps?: Omit<DaemonWriterLeaseDependencies, "identity">): DaemonWriterLease;
|
|
98
|
+
/**
|
|
99
|
+
* Lossy patch-compatible projection. `null` does not prove the lease path is
|
|
100
|
+
* physically absent; authority-sensitive callers must use strict inspection.
|
|
101
|
+
*/
|
|
31
102
|
export declare function daemonLeaseOwner(socketPath: string): DaemonLeaseOwner | null;
|
|
103
|
+
/** Raw signal-zero presence helper; daemon serviceability uses the classifier. */
|
|
32
104
|
export declare function processIsAlive(pid: number): boolean;
|
|
33
105
|
//# sourceMappingURL=writer-lease.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer-lease.d.ts","sourceRoot":"","sources":["../src/writer-lease.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writer-lease.d.ts","sourceRoot":"","sources":["../src/writer-lease.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,KAAK,EACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAGzB;;;;iDAIiD;AACjD,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAInE;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAU1D;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;gEAE4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,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