@cotal-ai/core 0.166.3 → 0.168.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/agent-endpoint.d.ts +242 -0
- package/dist/agent-endpoint.d.ts.map +1 -0
- package/dist/agent-endpoint.js +183 -0
- package/dist/agent-endpoint.js.map +1 -0
- package/dist/backup-config.d.ts +2 -2
- package/dist/endpoint-call.d.ts +36 -1
- package/dist/endpoint-call.d.ts.map +1 -1
- package/dist/endpoint-call.js +218 -116
- package/dist/endpoint-call.js.map +1 -1
- package/dist/endpoint-cluster.d.ts +6 -1
- package/dist/endpoint-cluster.d.ts.map +1 -1
- package/dist/endpoint-cluster.js +25 -1
- package/dist/endpoint-cluster.js.map +1 -1
- package/dist/endpoint-delivery-lease.d.ts +184 -0
- package/dist/endpoint-delivery-lease.d.ts.map +1 -0
- package/dist/endpoint-delivery-lease.js +270 -0
- package/dist/endpoint-delivery-lease.js.map +1 -0
- package/dist/endpoint-envelope.d.ts +4 -3
- package/dist/endpoint-envelope.d.ts.map +1 -1
- package/dist/endpoint-envelope.js +19 -2
- package/dist/endpoint-envelope.js.map +1 -1
- package/dist/endpoint-grants.d.ts +31 -1
- package/dist/endpoint-grants.d.ts.map +1 -1
- package/dist/endpoint-grants.js +62 -1
- package/dist/endpoint-grants.js.map +1 -1
- package/dist/endpoint-presence.d.ts +296 -0
- package/dist/endpoint-presence.d.ts.map +1 -0
- package/dist/endpoint-presence.js +784 -0
- package/dist/endpoint-presence.js.map +1 -0
- package/dist/endpoint-provenance.d.ts +11 -0
- package/dist/endpoint-provenance.d.ts.map +1 -0
- package/dist/endpoint-provenance.js +20 -0
- package/dist/endpoint-provenance.js.map +1 -0
- package/dist/endpoint-serve.d.ts +76 -2
- package/dist/endpoint-serve.d.ts.map +1 -1
- package/dist/endpoint-serve.js +332 -147
- package/dist/endpoint-serve.js.map +1 -1
- package/dist/endpoint-service.d.ts +5 -1
- package/dist/endpoint-service.d.ts.map +1 -1
- package/dist/endpoint-service.js +2 -1
- package/dist/endpoint-service.js.map +1 -1
- package/dist/endpoint-subjects.d.ts +76 -2
- package/dist/endpoint-subjects.d.ts.map +1 -1
- package/dist/endpoint-subjects.js +113 -2
- package/dist/endpoint-subjects.js.map +1 -1
- package/dist/endpoint-verbs.d.ts +1 -1
- package/dist/endpoint-verbs.d.ts.map +1 -1
- package/dist/endpoint-verbs.js +1 -1
- package/dist/endpoint-verbs.js.map +1 -1
- package/dist/endpoint.d.ts +132 -188
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +380 -790
- package/dist/endpoint.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/peer-label.d.ts +6 -5
- package/dist/peer-label.d.ts.map +1 -1
- package/dist/peer-label.js +7 -6
- package/dist/peer-label.js.map +1 -1
- package/dist/provision-jwt.d.ts +518 -0
- package/dist/provision-jwt.d.ts.map +1 -0
- package/dist/provision-jwt.js +641 -0
- package/dist/provision-jwt.js.map +1 -0
- package/dist/provision-permissions.d.ts +72 -0
- package/dist/provision-permissions.d.ts.map +1 -0
- package/dist/provision-permissions.js +2009 -0
- package/dist/provision-permissions.js.map +1 -0
- package/dist/provision-resources.d.ts +66 -0
- package/dist/provision-resources.d.ts.map +1 -0
- package/dist/provision-resources.js +61 -0
- package/dist/provision-resources.js.map +1 -0
- package/dist/provision-server-config.d.ts +115 -0
- package/dist/provision-server-config.d.ts.map +1 -0
- package/dist/provision-server-config.js +169 -0
- package/dist/provision-server-config.js.map +1 -0
- package/dist/provision.d.ts +19 -701
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +4 -2835
- package/dist/provision.js.map +1 -1
- package/dist/subjects.d.ts +3 -2
- package/dist/subjects.d.ts.map +1 -1
- package/dist/subjects.js +10 -2
- package/dist/subjects.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/endpoint-cluster.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { contractDigest, isContractDigest } from "./canonical.js";
|
|
23
23
|
import { parseClosureManifest } from "./contract-manifest.js";
|
|
24
24
|
import { ContractInvalidError, singleDocumentClosure } from "./schema-profile.js";
|
|
25
|
-
import { endpointToken, assertCommandToken, assertBoundedOwner, isEpAuthzMode } from "./endpoint-subjects.js";
|
|
25
|
+
import { endpointToken, assertCommandToken, assertBoundedOwner, isEpAuthzMode, isPrincipalAuthority } from "./endpoint-subjects.js";
|
|
26
26
|
const isRec = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
27
27
|
/** Reverse-DNS cluster type URN (§13.7: `ai.cotal.lifecycle`, `com.acme.deploy`). */
|
|
28
28
|
const URN = /^[a-z0-9][a-z0-9-]{0,62}(\.[a-z0-9][a-z0-9-]{0,62}){1,15}$/;
|
|
@@ -60,6 +60,7 @@ export function buildClusterDocument(urn, revision, rows) {
|
|
|
60
60
|
class: "ephemeral",
|
|
61
61
|
targeted: r.targeted,
|
|
62
62
|
...(r.modes ? { modes: [...r.modes] } : {}),
|
|
63
|
+
...(r.authorities ? { authorities: [...r.authorities] } : {}),
|
|
63
64
|
capability: r.capability,
|
|
64
65
|
inputDigest: singleDocumentClosure(r.input).closureDigest,
|
|
65
66
|
outputDigest: singleDocumentClosure(r.output).closureDigest,
|
|
@@ -106,6 +107,28 @@ export function parseClusterDocument(raw) {
|
|
|
106
107
|
invalid(`command "${name}" class ${JSON.stringify(cmd.class)} is not "ephemeral" | "journal"`);
|
|
107
108
|
if (typeof cmd.targeted !== "boolean")
|
|
108
109
|
invalid(`command "${name}" must declare targeted as a boolean (SPEC 13.7)`);
|
|
110
|
+
// THE PRINCIPAL ROUTE'S AUTHORITY WORDS (SPEC 13.21). The head of a principal-route subject is
|
|
111
|
+
// the target, so the command is untargeted and declares no §13.2 mode: the words are this
|
|
112
|
+
// route's own closed set. Declared per command so a word added to the set later admits nothing
|
|
113
|
+
// a revision-1 declaration did not list.
|
|
114
|
+
let authorities;
|
|
115
|
+
if (cmd.authorities !== undefined) {
|
|
116
|
+
if (cmd.targeted !== false)
|
|
117
|
+
invalid(`command "${name}" declares authorities and targeted: true; a principal-route command is untargeted, its subject head is the target (SPEC 13.21)`);
|
|
118
|
+
if (cmd.modes !== undefined)
|
|
119
|
+
invalid(`command "${name}" declares authorities beside authorization modes; the two belong to different routes (SPEC 13.21)`);
|
|
120
|
+
if (!Array.isArray(cmd.authorities) || cmd.authorities.length === 0)
|
|
121
|
+
invalid(`command "${name}" authorities must be a non-empty array of authority words (SPEC 13.21)`);
|
|
122
|
+
const uniq = new Set();
|
|
123
|
+
for (const w of cmd.authorities) {
|
|
124
|
+
if (typeof w !== "string" || !isPrincipalAuthority(w))
|
|
125
|
+
invalid(`command "${name}" admits unknown authority ${JSON.stringify(w)}`);
|
|
126
|
+
if (uniq.has(w))
|
|
127
|
+
invalid(`command "${name}" admits authority "${w}" twice`);
|
|
128
|
+
uniq.add(w);
|
|
129
|
+
}
|
|
130
|
+
authorities = [...cmd.authorities];
|
|
131
|
+
}
|
|
109
132
|
let modes;
|
|
110
133
|
if (cmd.targeted) {
|
|
111
134
|
if (!Array.isArray(cmd.modes) || cmd.modes.length === 0)
|
|
@@ -190,6 +213,7 @@ export function parseClusterDocument(raw) {
|
|
|
190
213
|
return {
|
|
191
214
|
name, class: cmd.class, targeted: cmd.targeted,
|
|
192
215
|
...(modes ? { modes } : {}),
|
|
216
|
+
...(authorities ? { authorities } : {}),
|
|
193
217
|
capability: cmd.capability, inputDigest: cmd.inputDigest, outputDigest: cmd.outputDigest,
|
|
194
218
|
...(traits ? { traits } : {}),
|
|
195
219
|
...(action ? { action } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-cluster.js","sourceRoot":"","sources":["../src/endpoint-cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;A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,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,oBAAoB,CAAC,oDAAoD,CAAC,CAAC;IAChH,OAAO,UAAU,CAAC;QAChB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,GAAG,CAAC,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvF,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAU,EAAE;QAC3B,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7B,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;YACpD,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC;SACjC,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { KV } from "@nats-io/kv";
|
|
2
|
+
import type { NatsConnection } from "@nats-io/transport-node";
|
|
3
|
+
import type { AgentCard } from "./types.js";
|
|
4
|
+
import { type DeliveryLeaseInfo } from "./lease.js";
|
|
5
|
+
type LeaseWatch = Awaited<ReturnType<KV["watch"]>>;
|
|
6
|
+
/** Connection and consumer custody shared with the endpoint's other broker readers. */
|
|
7
|
+
export interface EndpointDeliveryLeaseDeps {
|
|
8
|
+
card: () => AgentCard;
|
|
9
|
+
space: () => string;
|
|
10
|
+
connection: () => NatsConnection | undefined;
|
|
11
|
+
epoch: () => number;
|
|
12
|
+
notLiveMsg: () => string;
|
|
13
|
+
deleteWatchConsumer: (iter: LeaseWatch) => Promise<void>;
|
|
14
|
+
recoverable: (error: Error) => void;
|
|
15
|
+
emit: (event: string, error: Error) => boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Delivery lease ownership, readiness and watch intent for one endpoint instance. */
|
|
18
|
+
export declare class EndpointDeliveryLease {
|
|
19
|
+
private readonly deps;
|
|
20
|
+
private deliveryKv?;
|
|
21
|
+
/** This endpoint instance's LEASE INCARNATION: which run of this principal a lease row was written
|
|
22
|
+
* by. Minted per construction and never re-derived, because the credential cannot supply it, the
|
|
23
|
+
* daemon's cred is a file on disk that every restart re-reads, so `card.id` is stable across
|
|
24
|
+
* processes by design. See {@link DeliveryLeaseInfo.incarnation}. */
|
|
25
|
+
private readonly leaseIncarnation;
|
|
26
|
+
/** When this endpoint last WON each shard's lease create. Every later write of that row carries it
|
|
27
|
+
* unchanged, while `since` is re-stamped. See {@link DeliveryLeaseInfo.acquiredAt}. */
|
|
28
|
+
private readonly leaseAcquiredAt;
|
|
29
|
+
/** The daemon's lease-loss watch (#1596): the INTENT that survives a connection rebuild, plus the
|
|
30
|
+
* live iterator. See {@link watchDeliveryLease}. */
|
|
31
|
+
private leaseWatchIntent?;
|
|
32
|
+
private leaseWatchIter?;
|
|
33
|
+
/** Consumer deletes of retired lease watches still in flight. The stop handle cannot await its
|
|
34
|
+
* delete, so endpoint shutdown and a live-epoch rebuild await these before they close the connection
|
|
35
|
+
* that carries them (#3966). */
|
|
36
|
+
private readonly leaseWatchDeletes;
|
|
37
|
+
/** Lease-watch binds still awaiting the broker. One that lands after endpoint shutdown or a rebuild
|
|
38
|
+
* moved the epoch retires its watch and starts that delete itself, so the same two paths wait for
|
|
39
|
+
* these first. Each is bounded by the JetStream request timeout. */
|
|
40
|
+
private readonly leaseWatchBinds;
|
|
41
|
+
constructor(deps: EndpointDeliveryLeaseDeps);
|
|
42
|
+
private get card();
|
|
43
|
+
private get space();
|
|
44
|
+
private get nc();
|
|
45
|
+
private get presenceEpoch();
|
|
46
|
+
private notLiveMsg;
|
|
47
|
+
private emitRecoverable;
|
|
48
|
+
private emit;
|
|
49
|
+
get hasWatchIntent(): boolean;
|
|
50
|
+
resetConnection(): void;
|
|
51
|
+
/** Lazily open the delivery lease/readiness KV (pre-created at `cotal up`; bind, never create). */
|
|
52
|
+
private deliveryRegistry;
|
|
53
|
+
private encodeLease;
|
|
54
|
+
/** Is this shard's lease row one THIS ENDPOINT INSTANCE wrote? The question a daemon whose renew
|
|
55
|
+
* just failed has to answer before it decides whether it still owns the shard.
|
|
56
|
+
*
|
|
57
|
+
* Both halves are required. `holder` alone is not sufficient (a successor daemon re-reading the
|
|
58
|
+
* same creds file presents the same principal, so its row would read as ours), and `incarnation`
|
|
59
|
+
* alone is not sufficient either, it is a bare uuid with no claim to the principal, so a row
|
|
60
|
+
* bearing ours but a foreign holder is not something we should ever adopt. A row with NO
|
|
61
|
+
* incarnation predates the field and cannot be proven ours, which is the safe reading: it leads
|
|
62
|
+
* to the takeover path rather than to serving on someone else's claim. */
|
|
63
|
+
ownsDeliveryLease(info: DeliveryLeaseInfo): boolean;
|
|
64
|
+
/** Acquire the single-flight delivery lease for a shard via an ATOMIC CAS create, marked NOT-ready.
|
|
65
|
+
* THROWS if a live lease exists - a loud refusal-to-bind (the daemon exits), never a retry, so two
|
|
66
|
+
* daemons can't split a durable's delivery. A crashed holder's lease auto-expires (bucket TTL),
|
|
67
|
+
* freeing a re-acquire. Acquired BEFORE binding (single-flight gate); {@link markDeliveryLeaseReady}
|
|
68
|
+
* flips it ready AFTER the loops + `ctl.delivery` are bound. Returns the lease revision. */
|
|
69
|
+
acquireDeliveryLease(shardIndex: number): Promise<number>;
|
|
70
|
+
/** Flip the held lease to READY (CAS `kv.update`) AFTER `startPlane3` has bound the loops + the
|
|
71
|
+
* `ctl.delivery` responder - so "lease ready" proves the responder is up, not just that the slot was
|
|
72
|
+
* claimed. Returns the new revision. */
|
|
73
|
+
markDeliveryLeaseReady(shardIndex: number, revision: number): Promise<number>;
|
|
74
|
+
/** Flip the held lease back to NOT-ready, the counterpart to {@link markDeliveryLeaseReady}, for a
|
|
75
|
+
* holder that has UNBOUND its loops and control responder but has not given up the shard.
|
|
76
|
+
*
|
|
77
|
+
* `ready` is a claim about the RESPONDER, not about the row's existence: `ensureDelivery` waits on
|
|
78
|
+
* it and the channel-health surface reports it. A daemon that goes quiet to re-check its ownership
|
|
79
|
+
* still holds the key, so without this the space would be told a responder is up while nothing is
|
|
80
|
+
* bound, a readiness lie of exactly the kind #1318 is about, just pointed the other way. Keeping
|
|
81
|
+
* the row (rather than deleting it) is deliberate: the shard is still claimed, so no third daemon
|
|
82
|
+
* should be invited in; what is being withdrawn is only the claim to be answering. */
|
|
83
|
+
markDeliveryLeaseNotReady(shardIndex: number, revision: number): Promise<number>;
|
|
84
|
+
/** Renew the held lease (CAS `kv.update` against `revision`, keeping `ready:true`) to refresh it before
|
|
85
|
+
* the bucket TTL expires it. Returns the new revision. Throws if the revision moved (lost the lease -
|
|
86
|
+
* the daemon should exit). */
|
|
87
|
+
renewDeliveryLease(shardIndex: number, revision: number): Promise<number>;
|
|
88
|
+
/** Release the held lease on clean shutdown so a replacement daemon re-acquires immediately (a
|
|
89
|
+
* crash just lets the bucket TTL expire it).
|
|
90
|
+
*
|
|
91
|
+
* THE REVISION IS WHAT MAKES THIS A RELEASE RATHER THAN A DELETE. An unconditional delete removes
|
|
92
|
+
* whatever row is there, and by shutdown time the row is not necessarily still ours: the exit
|
|
93
|
+
* paths that matter most are precisely the ones where another daemon has taken the shard, so the
|
|
94
|
+
* departing process would delete the REPLACEMENT's lease on its way out and leave the shard with
|
|
95
|
+
* no holder at all. Passing the revision this endpoint last owned makes the delete a compare-and-
|
|
96
|
+
* swap (`previousSeq` becomes JetStream's `ExpectedLastSubjectSequence`), so a row that has moved
|
|
97
|
+
* on is left alone.
|
|
98
|
+
*
|
|
99
|
+
* A RELEASE THAT DID NOT COMMIT REJECTS. The broker's CAS refusal and any broker failure reach the
|
|
100
|
+
* caller, because only the caller knows whether that matters: a shutdown that must finish anyway
|
|
101
|
+
* catches it, and a close that reports whether a successor can start learns the outcome here.
|
|
102
|
+
*
|
|
103
|
+
* THE ARGUMENT IS REQUIRED, AND EXPLICITLY NULLABLE RATHER THAN OPTIONAL. `undefined` means "this
|
|
104
|
+
* process no longer holds a revision it can argue for", which is the takeover paths' honest
|
|
105
|
+
* answer and correctly releases nothing, the bucket TTL is the crash-safe authority and expires
|
|
106
|
+
* a genuinely stale row. But if that were the DEFAULT, every existing `releaseDeliveryLease(0)`
|
|
107
|
+
* call site would keep compiling and silently stop releasing: the same omission hole
|
|
108
|
+
* `standaloneConnectOpts` closed by deleting its `= {}`. Measured, not theorised, this landed as
|
|
109
|
+
* a red in `smoke:delivery-lease`, where a caller that genuinely held the lease released nothing
|
|
110
|
+
* and the next acquire was refused. A caller must now say which it means. */
|
|
111
|
+
releaseDeliveryLease(shardIndex: number, revision: number | undefined): Promise<void>;
|
|
112
|
+
/** Read a shard's delivery lease (the daemon-availability signal), or `undefined` if none is live.
|
|
113
|
+
* READ-ONLY surface - drives Component 6's `cotal_channels` delivery-health field (an agent reads it
|
|
114
|
+
* under its own cred, which holds lease-bucket read but no write). */
|
|
115
|
+
readDeliveryLease(shardIndex: number): Promise<DeliveryLeaseInfo | undefined>;
|
|
116
|
+
/** Watch THIS shard's lease key and nothing else, for the daemon's loss trigger (#1596).
|
|
117
|
+
*
|
|
118
|
+
* A KV watch is the native JetStream push for "the row changed hands NOW": a filtered ordered
|
|
119
|
+
* consumer on the lease bucket delivers the row's own writes the moment the broker applies them,
|
|
120
|
+
* instead of the daemon waiting for its next renew tick to notice. The watch is a TRIGGER, never a
|
|
121
|
+
* decision: every event is handed to `onEvent` with the row as the broker now states it (PUT) or
|
|
122
|
+
* the fact it is gone (DEL/PURGE, `info` undefined), and the caller re-runs the SAME decision tree
|
|
123
|
+
* its renew tick would (`leaseAction`, `mayServeOn`, `readOwnLease`-style ownership tests). An
|
|
124
|
+
* event the daemon itself caused (its acquire, its renew, its ready flip) is an ordinary input to
|
|
125
|
+
* that tree - the row still reads `held` by this endpoint - so it never quiesces on its own write;
|
|
126
|
+
* no event filtering happens here.
|
|
127
|
+
*
|
|
128
|
+
* Like the presence watch, this survives a connection rebuild as INTENT: the iterator dies with
|
|
129
|
+
* its connection and the endpoint connection bind rebinds it onto the fresh one, so a reconnect can
|
|
130
|
+
* never leave the daemon blind to the row for the rest of its life. The rebind replays the
|
|
131
|
+
* bucket's current last-per-subject state, so a change that landed during the null window is
|
|
132
|
+
* delivered on the fresh watch. Resolves a stop handle. */
|
|
133
|
+
watchDeliveryLease(shardIndex: number, onEvent: (info: DeliveryLeaseInfo | undefined) => void): Promise<() => void>;
|
|
134
|
+
stopDeliveryLeaseWatch(): void;
|
|
135
|
+
/** Stop a lease watch and delete its ordered consumer, which the stop alone leaves on the broker
|
|
136
|
+
* until its five-minute inactive threshold (#3966). A connection that closed on its own cannot
|
|
137
|
+
* carry the delete, so that consumer is left to the threshold. A failed delete is a warning: the
|
|
138
|
+
* broker still reaps the consumer, and the daemon's synchronous stop handle has no caller to
|
|
139
|
+
* reject. */
|
|
140
|
+
private retireDeliveryLeaseWatch;
|
|
141
|
+
/** Wait for the lease-watch binds still in flight, then for every retired watch's consumer delete.
|
|
142
|
+
* endpoint shutdown and a live-epoch rebuild run this before they close the connection those deletes
|
|
143
|
+
* need (#3966). */
|
|
144
|
+
settleDeliveryLeaseWatches(): Promise<void>;
|
|
145
|
+
/** Bind the lease watch on the current connection. A bind that lands after a newer watch replaced
|
|
146
|
+
* its intent, or after a stop or connection teardown moved the epoch, retires its watch instead of
|
|
147
|
+
* installing it: the epoch it was bound for is gone, and a rebuilt one binds its own. */
|
|
148
|
+
bindDeliveryLeaseWatch(): Promise<void>;
|
|
149
|
+
private bindDeliveryLeaseWatchOnce;
|
|
150
|
+
/** The principal recorded as holding a shard's delivery lease, read by THIS process from the row,
|
|
151
|
+
* or `undefined` when no row is live or the read failed.
|
|
152
|
+
*
|
|
153
|
+
* THE POINT IS WHO ESTABLISHES THE FACT. Everything a requester learns from a request/reply rail
|
|
154
|
+
* is something a responder chose to send, and the delivery-admin rail is queue-grouped, so any
|
|
155
|
+
* process permitted to serve it decides what arrives. The lease row is the other kind of fact: a
|
|
156
|
+
* KV key whose only writer is the `delivery` credential's own `lease.*` grant, read here under
|
|
157
|
+
* THIS endpoint's credential, which no reply on any rail participates in. A caller comparing an
|
|
158
|
+
* answerer against the holder needs that, rather than the answerer's word for which one it is.
|
|
159
|
+
*
|
|
160
|
+
* `undefined` is a genuine unknown and is NEVER a statement that nobody holds the shard: a read
|
|
161
|
+
* that throws (a denied or unreadable bucket, a broker that will not answer) must not collapse
|
|
162
|
+
* into "nothing is there". Callers must treat it as a failure to determine (#1694). */
|
|
163
|
+
deliveryLeaseHolder(shardIndex: number): Promise<string | undefined>;
|
|
164
|
+
/** The lease row AND the KV revision it is at. The revision is the CAS token every renew and the
|
|
165
|
+
* CAS release are argued against, so a caller re-establishing ownership after a failed renew
|
|
166
|
+
* needs the BROKER's sequence, not the one it last cached: a renew can fail with its write
|
|
167
|
+
* already applied (a lost reply, a reconnect mid-request), which leaves the cached revision one
|
|
168
|
+
* behind forever and every subsequent CAS refused over a sequence this process itself moved ,
|
|
169
|
+
* read as somebody else's takeover, which is the #1318 misreading in a second costume.
|
|
170
|
+
*
|
|
171
|
+
* ABSENT and UNREADABLE are different facts and this method keeps them apart (#1694): `undefined`
|
|
172
|
+
* means NO row is live (no key, or DEL/PURGE), while a key that EXISTS but does not parse as a
|
|
173
|
+
* {@link DeliveryLeaseInfo} THROWS. Folding the parse failure into `undefined` made a live-but-
|
|
174
|
+
* corrupt row read as "nothing there", and the store-identity challenge's absence settlement
|
|
175
|
+
* then certified a remint over a row it could not read. A caller that wants the old swallow
|
|
176
|
+
* (an owner testing "is this provably MINE") still gets its safe answer: an unparseable row is
|
|
177
|
+
* not provably anyone's, and catching here reads as `false` exactly as before. */
|
|
178
|
+
readDeliveryLeaseEntry(shardIndex: number): Promise<{
|
|
179
|
+
info: DeliveryLeaseInfo;
|
|
180
|
+
revision: number;
|
|
181
|
+
} | undefined>;
|
|
182
|
+
}
|
|
183
|
+
export {};
|
|
184
|
+
//# sourceMappingURL=endpoint-delivery-lease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-delivery-lease.d.ts","sourceRoot":"","sources":["../src/endpoint-delivery-lease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG1E,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEnD,uFAAuF;AACvF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,cAAc,GAAG,SAAS,CAAC;IAC7C,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CAChD;AAED,sFAAsF;AACtF,qBAAa,qBAAqB;IAgCpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IA9BjC,OAAO,CAAC,UAAU,CAAC,CAAK;IAGxB;;;0EAGsE;IACtE,OAA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AAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3F;;2EAEuE;IACjE,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAKnF;;;;;;;;;;;;;;;;gEAgB4D;IACtD,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC;IAWzH,sBAAsB,IAAI,IAAI;IAM9B;;;;kBAIc;IACd,OAAO,CAAC,wBAAwB;IAWhC;;wBAEoB;IACd,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjD;;8FAE0F;IAC1F,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;YASzB,0BAA0B;IAmBxC;;;;;;;;;;;;4FAYwF;IAClF,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAM1E;;;;;;;;;;;;;uFAamF;IAC7E,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAMrH"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { openDeliveryRegistry } from "./lease.js";
|
|
3
|
+
import { leaseKey } from "./subjects.js";
|
|
4
|
+
/** Delivery lease ownership, readiness and watch intent for one endpoint instance. */
|
|
5
|
+
export class EndpointDeliveryLease {
|
|
6
|
+
deps;
|
|
7
|
+
deliveryKv;
|
|
8
|
+
/** This endpoint instance's LEASE INCARNATION: which run of this principal a lease row was written
|
|
9
|
+
* by. Minted per construction and never re-derived, because the credential cannot supply it, the
|
|
10
|
+
* daemon's cred is a file on disk that every restart re-reads, so `card.id` is stable across
|
|
11
|
+
* processes by design. See {@link DeliveryLeaseInfo.incarnation}. */
|
|
12
|
+
leaseIncarnation = randomUUID();
|
|
13
|
+
/** When this endpoint last WON each shard's lease create. Every later write of that row carries it
|
|
14
|
+
* unchanged, while `since` is re-stamped. See {@link DeliveryLeaseInfo.acquiredAt}. */
|
|
15
|
+
leaseAcquiredAt = new Map();
|
|
16
|
+
/** The daemon's lease-loss watch (#1596): the INTENT that survives a connection rebuild, plus the
|
|
17
|
+
* live iterator. See {@link watchDeliveryLease}. */
|
|
18
|
+
leaseWatchIntent;
|
|
19
|
+
leaseWatchIter;
|
|
20
|
+
/** Consumer deletes of retired lease watches still in flight. The stop handle cannot await its
|
|
21
|
+
* delete, so endpoint shutdown and a live-epoch rebuild await these before they close the connection
|
|
22
|
+
* that carries them (#3966). */
|
|
23
|
+
leaseWatchDeletes = new Set();
|
|
24
|
+
/** Lease-watch binds still awaiting the broker. One that lands after endpoint shutdown or a rebuild
|
|
25
|
+
* moved the epoch retires its watch and starts that delete itself, so the same two paths wait for
|
|
26
|
+
* these first. Each is bounded by the JetStream request timeout. */
|
|
27
|
+
leaseWatchBinds = new Set();
|
|
28
|
+
constructor(deps) {
|
|
29
|
+
this.deps = deps;
|
|
30
|
+
}
|
|
31
|
+
get card() { return this.deps.card(); }
|
|
32
|
+
get space() { return this.deps.space(); }
|
|
33
|
+
get nc() { return this.deps.connection(); }
|
|
34
|
+
get presenceEpoch() { return this.deps.epoch(); }
|
|
35
|
+
notLiveMsg() { return this.deps.notLiveMsg(); }
|
|
36
|
+
emitRecoverable(error) { this.deps.recoverable(error); }
|
|
37
|
+
emit(event, error) { return this.deps.emit(event, error); }
|
|
38
|
+
get hasWatchIntent() { return this.leaseWatchIntent !== undefined; }
|
|
39
|
+
resetConnection() { this.deliveryKv = undefined; }
|
|
40
|
+
/** Lazily open the delivery lease/readiness KV (pre-created at `cotal up`; bind, never create). */
|
|
41
|
+
async deliveryRegistry() {
|
|
42
|
+
if (!this.nc)
|
|
43
|
+
throw new Error(this.notLiveMsg());
|
|
44
|
+
this.deliveryKv ??= await openDeliveryRegistry(this.nc, this.space);
|
|
45
|
+
return this.deliveryKv;
|
|
46
|
+
}
|
|
47
|
+
encodeLease(shardIndex, ready, acquiredAt = this.leaseAcquiredAt.get(shardIndex)) {
|
|
48
|
+
return new TextEncoder().encode(JSON.stringify({ holder: this.card.id, incarnation: this.leaseIncarnation, acquiredAt, since: Date.now(), ready }));
|
|
49
|
+
}
|
|
50
|
+
/** Is this shard's lease row one THIS ENDPOINT INSTANCE wrote? The question a daemon whose renew
|
|
51
|
+
* just failed has to answer before it decides whether it still owns the shard.
|
|
52
|
+
*
|
|
53
|
+
* Both halves are required. `holder` alone is not sufficient (a successor daemon re-reading the
|
|
54
|
+
* same creds file presents the same principal, so its row would read as ours), and `incarnation`
|
|
55
|
+
* alone is not sufficient either, it is a bare uuid with no claim to the principal, so a row
|
|
56
|
+
* bearing ours but a foreign holder is not something we should ever adopt. A row with NO
|
|
57
|
+
* incarnation predates the field and cannot be proven ours, which is the safe reading: it leads
|
|
58
|
+
* to the takeover path rather than to serving on someone else's claim. */
|
|
59
|
+
ownsDeliveryLease(info) {
|
|
60
|
+
return info.holder === this.card.id && info.incarnation !== undefined && info.incarnation === this.leaseIncarnation;
|
|
61
|
+
}
|
|
62
|
+
/** Acquire the single-flight delivery lease for a shard via an ATOMIC CAS create, marked NOT-ready.
|
|
63
|
+
* THROWS if a live lease exists - a loud refusal-to-bind (the daemon exits), never a retry, so two
|
|
64
|
+
* daemons can't split a durable's delivery. A crashed holder's lease auto-expires (bucket TTL),
|
|
65
|
+
* freeing a re-acquire. Acquired BEFORE binding (single-flight gate); {@link markDeliveryLeaseReady}
|
|
66
|
+
* flips it ready AFTER the loops + `ctl.delivery` are bound. Returns the lease revision. */
|
|
67
|
+
async acquireDeliveryLease(shardIndex) {
|
|
68
|
+
// Recorded only once the create wins: a refused create leaves the held row, and so its time, as it was.
|
|
69
|
+
const acquiredAt = Date.now();
|
|
70
|
+
const revision = await (await this.deliveryRegistry()).create(leaseKey(shardIndex), this.encodeLease(shardIndex, false, acquiredAt));
|
|
71
|
+
this.leaseAcquiredAt.set(shardIndex, acquiredAt);
|
|
72
|
+
return revision;
|
|
73
|
+
}
|
|
74
|
+
/** Flip the held lease to READY (CAS `kv.update`) AFTER `startPlane3` has bound the loops + the
|
|
75
|
+
* `ctl.delivery` responder - so "lease ready" proves the responder is up, not just that the slot was
|
|
76
|
+
* claimed. Returns the new revision. */
|
|
77
|
+
async markDeliveryLeaseReady(shardIndex, revision) {
|
|
78
|
+
return (await this.deliveryRegistry()).update(leaseKey(shardIndex), this.encodeLease(shardIndex, true), revision);
|
|
79
|
+
}
|
|
80
|
+
/** Flip the held lease back to NOT-ready, the counterpart to {@link markDeliveryLeaseReady}, for a
|
|
81
|
+
* holder that has UNBOUND its loops and control responder but has not given up the shard.
|
|
82
|
+
*
|
|
83
|
+
* `ready` is a claim about the RESPONDER, not about the row's existence: `ensureDelivery` waits on
|
|
84
|
+
* it and the channel-health surface reports it. A daemon that goes quiet to re-check its ownership
|
|
85
|
+
* still holds the key, so without this the space would be told a responder is up while nothing is
|
|
86
|
+
* bound, a readiness lie of exactly the kind #1318 is about, just pointed the other way. Keeping
|
|
87
|
+
* the row (rather than deleting it) is deliberate: the shard is still claimed, so no third daemon
|
|
88
|
+
* should be invited in; what is being withdrawn is only the claim to be answering. */
|
|
89
|
+
async markDeliveryLeaseNotReady(shardIndex, revision) {
|
|
90
|
+
return (await this.deliveryRegistry()).update(leaseKey(shardIndex), this.encodeLease(shardIndex, false), revision);
|
|
91
|
+
}
|
|
92
|
+
/** Renew the held lease (CAS `kv.update` against `revision`, keeping `ready:true`) to refresh it before
|
|
93
|
+
* the bucket TTL expires it. Returns the new revision. Throws if the revision moved (lost the lease -
|
|
94
|
+
* the daemon should exit). */
|
|
95
|
+
async renewDeliveryLease(shardIndex, revision) {
|
|
96
|
+
return (await this.deliveryRegistry()).update(leaseKey(shardIndex), this.encodeLease(shardIndex, true), revision);
|
|
97
|
+
}
|
|
98
|
+
/** Release the held lease on clean shutdown so a replacement daemon re-acquires immediately (a
|
|
99
|
+
* crash just lets the bucket TTL expire it).
|
|
100
|
+
*
|
|
101
|
+
* THE REVISION IS WHAT MAKES THIS A RELEASE RATHER THAN A DELETE. An unconditional delete removes
|
|
102
|
+
* whatever row is there, and by shutdown time the row is not necessarily still ours: the exit
|
|
103
|
+
* paths that matter most are precisely the ones where another daemon has taken the shard, so the
|
|
104
|
+
* departing process would delete the REPLACEMENT's lease on its way out and leave the shard with
|
|
105
|
+
* no holder at all. Passing the revision this endpoint last owned makes the delete a compare-and-
|
|
106
|
+
* swap (`previousSeq` becomes JetStream's `ExpectedLastSubjectSequence`), so a row that has moved
|
|
107
|
+
* on is left alone.
|
|
108
|
+
*
|
|
109
|
+
* A RELEASE THAT DID NOT COMMIT REJECTS. The broker's CAS refusal and any broker failure reach the
|
|
110
|
+
* caller, because only the caller knows whether that matters: a shutdown that must finish anyway
|
|
111
|
+
* catches it, and a close that reports whether a successor can start learns the outcome here.
|
|
112
|
+
*
|
|
113
|
+
* THE ARGUMENT IS REQUIRED, AND EXPLICITLY NULLABLE RATHER THAN OPTIONAL. `undefined` means "this
|
|
114
|
+
* process no longer holds a revision it can argue for", which is the takeover paths' honest
|
|
115
|
+
* answer and correctly releases nothing, the bucket TTL is the crash-safe authority and expires
|
|
116
|
+
* a genuinely stale row. But if that were the DEFAULT, every existing `releaseDeliveryLease(0)`
|
|
117
|
+
* call site would keep compiling and silently stop releasing: the same omission hole
|
|
118
|
+
* `standaloneConnectOpts` closed by deleting its `= {}`. Measured, not theorised, this landed as
|
|
119
|
+
* a red in `smoke:delivery-lease`, where a caller that genuinely held the lease released nothing
|
|
120
|
+
* and the next acquire was refused. A caller must now say which it means. */
|
|
121
|
+
async releaseDeliveryLease(shardIndex, revision) {
|
|
122
|
+
if (revision === undefined)
|
|
123
|
+
return;
|
|
124
|
+
await (await this.deliveryRegistry()).delete(leaseKey(shardIndex), { previousSeq: revision });
|
|
125
|
+
}
|
|
126
|
+
/** Read a shard's delivery lease (the daemon-availability signal), or `undefined` if none is live.
|
|
127
|
+
* READ-ONLY surface - drives Component 6's `cotal_channels` delivery-health field (an agent reads it
|
|
128
|
+
* under its own cred, which holds lease-bucket read but no write). */
|
|
129
|
+
async readDeliveryLease(shardIndex) {
|
|
130
|
+
return (await this.readDeliveryLeaseEntry(shardIndex))?.info;
|
|
131
|
+
}
|
|
132
|
+
/** Watch THIS shard's lease key and nothing else, for the daemon's loss trigger (#1596).
|
|
133
|
+
*
|
|
134
|
+
* A KV watch is the native JetStream push for "the row changed hands NOW": a filtered ordered
|
|
135
|
+
* consumer on the lease bucket delivers the row's own writes the moment the broker applies them,
|
|
136
|
+
* instead of the daemon waiting for its next renew tick to notice. The watch is a TRIGGER, never a
|
|
137
|
+
* decision: every event is handed to `onEvent` with the row as the broker now states it (PUT) or
|
|
138
|
+
* the fact it is gone (DEL/PURGE, `info` undefined), and the caller re-runs the SAME decision tree
|
|
139
|
+
* its renew tick would (`leaseAction`, `mayServeOn`, `readOwnLease`-style ownership tests). An
|
|
140
|
+
* event the daemon itself caused (its acquire, its renew, its ready flip) is an ordinary input to
|
|
141
|
+
* that tree - the row still reads `held` by this endpoint - so it never quiesces on its own write;
|
|
142
|
+
* no event filtering happens here.
|
|
143
|
+
*
|
|
144
|
+
* Like the presence watch, this survives a connection rebuild as INTENT: the iterator dies with
|
|
145
|
+
* its connection and the endpoint connection bind rebinds it onto the fresh one, so a reconnect can
|
|
146
|
+
* never leave the daemon blind to the row for the rest of its life. The rebind replays the
|
|
147
|
+
* bucket's current last-per-subject state, so a change that landed during the null window is
|
|
148
|
+
* delivered on the fresh watch. Resolves a stop handle. */
|
|
149
|
+
async watchDeliveryLease(shardIndex, onEvent) {
|
|
150
|
+
this.leaseWatchIntent = { shardIndex, onEvent };
|
|
151
|
+
await this.bindDeliveryLeaseWatch();
|
|
152
|
+
return () => {
|
|
153
|
+
if (this.leaseWatchIntent?.onEvent !== onEvent)
|
|
154
|
+
return; // a later watch owns the slot
|
|
155
|
+
this.leaseWatchIntent = undefined;
|
|
156
|
+
this.stopDeliveryLeaseWatch();
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
stopDeliveryLeaseWatch() {
|
|
160
|
+
if (this.leaseWatchIter)
|
|
161
|
+
this.retireDeliveryLeaseWatch(this.leaseWatchIter);
|
|
162
|
+
this.leaseWatchIter = undefined;
|
|
163
|
+
}
|
|
164
|
+
/** Stop a lease watch and delete its ordered consumer, which the stop alone leaves on the broker
|
|
165
|
+
* until its five-minute inactive threshold (#3966). A connection that closed on its own cannot
|
|
166
|
+
* carry the delete, so that consumer is left to the threshold. A failed delete is a warning: the
|
|
167
|
+
* broker still reaps the consumer, and the daemon's synchronous stop handle has no caller to
|
|
168
|
+
* reject. */
|
|
169
|
+
retireDeliveryLeaseWatch(iter) {
|
|
170
|
+
try {
|
|
171
|
+
iter.stop();
|
|
172
|
+
}
|
|
173
|
+
catch { /* already closed with its connection */ }
|
|
174
|
+
if (!this.nc || this.nc.isClosed())
|
|
175
|
+
return;
|
|
176
|
+
const deleting = this.deps.deleteWatchConsumer(iter).catch((e) => this.emitRecoverable(new Error(`a retired delivery lease watch consumer was not deleted (${e.message}); the broker reaps it at its inactive threshold`)));
|
|
177
|
+
this.leaseWatchDeletes.add(deleting);
|
|
178
|
+
void deleting.then(() => this.leaseWatchDeletes.delete(deleting));
|
|
179
|
+
}
|
|
180
|
+
/** Wait for the lease-watch binds still in flight, then for every retired watch's consumer delete.
|
|
181
|
+
* endpoint shutdown and a live-epoch rebuild run this before they close the connection those deletes
|
|
182
|
+
* need (#3966). */
|
|
183
|
+
async settleDeliveryLeaseWatches() {
|
|
184
|
+
await Promise.allSettled(this.leaseWatchBinds);
|
|
185
|
+
await Promise.all(this.leaseWatchDeletes);
|
|
186
|
+
}
|
|
187
|
+
/** Bind the lease watch on the current connection. A bind that lands after a newer watch replaced
|
|
188
|
+
* its intent, or after a stop or connection teardown moved the epoch, retires its watch instead of
|
|
189
|
+
* installing it: the epoch it was bound for is gone, and a rebuilt one binds its own. */
|
|
190
|
+
bindDeliveryLeaseWatch() {
|
|
191
|
+
const binding = this.bindDeliveryLeaseWatchOnce();
|
|
192
|
+
const settled = () => { this.leaseWatchBinds.delete(binding); };
|
|
193
|
+
this.leaseWatchBinds.add(binding);
|
|
194
|
+
void binding.then(settled, settled);
|
|
195
|
+
return binding;
|
|
196
|
+
}
|
|
197
|
+
async bindDeliveryLeaseWatchOnce() {
|
|
198
|
+
const intent = this.leaseWatchIntent;
|
|
199
|
+
const epoch = this.presenceEpoch;
|
|
200
|
+
const iter = await (await this.deliveryRegistry()).watch({ key: leaseKey(intent.shardIndex) });
|
|
201
|
+
if (this.leaseWatchIntent !== intent || epoch !== this.presenceEpoch) {
|
|
202
|
+
this.retireDeliveryLeaseWatch(iter);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.leaseWatchIter = iter;
|
|
206
|
+
void (async () => {
|
|
207
|
+
for await (const e of iter) {
|
|
208
|
+
if (this.leaseWatchIter !== iter)
|
|
209
|
+
break;
|
|
210
|
+
if (e.operation === "DEL" || e.operation === "PURGE") {
|
|
211
|
+
intent.onEvent(undefined);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
intent.onEvent(e.json());
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
intent.onEvent(undefined);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
})().catch((e) => this.emit("error", e));
|
|
222
|
+
}
|
|
223
|
+
/** The principal recorded as holding a shard's delivery lease, read by THIS process from the row,
|
|
224
|
+
* or `undefined` when no row is live or the read failed.
|
|
225
|
+
*
|
|
226
|
+
* THE POINT IS WHO ESTABLISHES THE FACT. Everything a requester learns from a request/reply rail
|
|
227
|
+
* is something a responder chose to send, and the delivery-admin rail is queue-grouped, so any
|
|
228
|
+
* process permitted to serve it decides what arrives. The lease row is the other kind of fact: a
|
|
229
|
+
* KV key whose only writer is the `delivery` credential's own `lease.*` grant, read here under
|
|
230
|
+
* THIS endpoint's credential, which no reply on any rail participates in. A caller comparing an
|
|
231
|
+
* answerer against the holder needs that, rather than the answerer's word for which one it is.
|
|
232
|
+
*
|
|
233
|
+
* `undefined` is a genuine unknown and is NEVER a statement that nobody holds the shard: a read
|
|
234
|
+
* that throws (a denied or unreadable bucket, a broker that will not answer) must not collapse
|
|
235
|
+
* into "nothing is there". Callers must treat it as a failure to determine (#1694). */
|
|
236
|
+
async deliveryLeaseHolder(shardIndex) {
|
|
237
|
+
try {
|
|
238
|
+
return (await this.readDeliveryLeaseEntry(shardIndex))?.info.holder;
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** The lease row AND the KV revision it is at. The revision is the CAS token every renew and the
|
|
245
|
+
* CAS release are argued against, so a caller re-establishing ownership after a failed renew
|
|
246
|
+
* needs the BROKER's sequence, not the one it last cached: a renew can fail with its write
|
|
247
|
+
* already applied (a lost reply, a reconnect mid-request), which leaves the cached revision one
|
|
248
|
+
* behind forever and every subsequent CAS refused over a sequence this process itself moved ,
|
|
249
|
+
* read as somebody else's takeover, which is the #1318 misreading in a second costume.
|
|
250
|
+
*
|
|
251
|
+
* ABSENT and UNREADABLE are different facts and this method keeps them apart (#1694): `undefined`
|
|
252
|
+
* means NO row is live (no key, or DEL/PURGE), while a key that EXISTS but does not parse as a
|
|
253
|
+
* {@link DeliveryLeaseInfo} THROWS. Folding the parse failure into `undefined` made a live-but-
|
|
254
|
+
* corrupt row read as "nothing there", and the store-identity challenge's absence settlement
|
|
255
|
+
* then certified a remint over a row it could not read. A caller that wants the old swallow
|
|
256
|
+
* (an owner testing "is this provably MINE") still gets its safe answer: an unparseable row is
|
|
257
|
+
* not provably anyone's, and catching here reads as `false` exactly as before. */
|
|
258
|
+
async readDeliveryLeaseEntry(shardIndex) {
|
|
259
|
+
const e = await (await this.deliveryRegistry()).get(leaseKey(shardIndex));
|
|
260
|
+
if (!e || e.operation === "DEL" || e.operation === "PURGE")
|
|
261
|
+
return undefined;
|
|
262
|
+
try {
|
|
263
|
+
return { info: e.json(), revision: e.revision };
|
|
264
|
+
}
|
|
265
|
+
catch (err) {
|
|
266
|
+
throw new Error(`delivery lease row "${leaseKey(shardIndex)}" exists but does not parse as a lease record (${err.message}) - it is unreadable, not absent`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=endpoint-delivery-lease.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-delivery-lease.js","sourceRoot":"","sources":["../src/endpoint-delivery-lease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,oBAAoB,EAA0B,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC,sFAAsF;AACtF,MAAM,OAAO,qBAAqB;IAgCH;IA9BrB,UAAU,CAAM;IAGxB;;;0EAGsE;IACrD,gBAAgB,GAAG,UAAU,EAAE,CAAC;IAGjD;4FACwF;IACvE,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE7D;yDACqD;IAC7C,gBAAgB,CAAkF;IAElG,cAAc,CAAoC;IAE1D;;qCAEiC;IAChB,iBAAiB,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE9D;;yEAEqE;IACpD,eAAe,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE5D,YAA6B,IAA+B;QAA/B,SAAI,GAAJ,IAAI,CAA2B;IAAG,CAAC;IAEhE,IAAY,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,IAAY,KAAK,KAAK,OAAO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,CAAC,OAAO,EAAE,CAAU,CAAC,CAAC,CAAC;IACpD,CAAC;IAGD;;;;;;;;;;;;4FAYwF;IACxF,KAAK,CAAC,mBAAmB,CAAC,UAAkB;QAC1C,IAAI,CAAC;YAAC,OAAO,CAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;QAAC,CAAC;QAC5E,MAAM,CAAC;YAAC,OAAO,SAAS,CAAC;QAAC,CAAC;IAC7B,CAAC;IAGD;;;;;;;;;;;;;uFAamF;IACnF,KAAK,CAAC,sBAAsB,CAAC,UAAkB;QAC7C,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,KAAK,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO;YAAE,OAAO,SAAS,CAAC;QAC7E,IAAI,CAAC;YAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAqB,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QAAC,CAAC;QAC3E,OAAO,GAAG,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,UAAU,CAAC,kDAAmD,GAAa,CAAC,OAAO,kCAAkC,CAAC,CAAC;QAAC,CAAC;IACzL,CAAC;CACF"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* registration-time `contract-invalid`).
|
|
14
14
|
*/
|
|
15
15
|
import type { ContractValidator } from "./contract-validator.js";
|
|
16
|
-
import { type ParsedEpRequest } from "./endpoint-subjects.js";
|
|
16
|
+
import { type ParsedEpPrincipalRequest, type ParsedEpRequest } from "./endpoint-subjects.js";
|
|
17
17
|
import type { ControlReply, EndpointRef } from "./types.js";
|
|
18
18
|
import { EpEnvelopeError, type EpError } from "./endpoint-error.js";
|
|
19
19
|
export { EP_ERROR_CODES, EpEnvelopeError, EP_UNBOUND_RESPONDER, respondedButUnbound, EP_UNANSWERED, unansweredRequest, unansweredRail, EP_REGISTRY_READ_FAILED, registryReadFailed, EP_NO_LIVE_INSTANCES, noLiveInstances, EP_UNDECLARED_ARG, undeclaredArg, undeclaredArgInstance, EP_BIND_REFUSED, replyRefusedBeforeEffect, bindRefusalMarked, EP_TARGET_UNMAPPED, replyTargetUnmapped, EP_LIFECYCLE_BLOCKED, lifecycleBlocked, lifecycleBlockedDetail, lifecycleBlockedFrom, renderLifecycleBlocked, EP_SEAT_CAP, seatCapDetail, seatCapRefused, seatCapFrom, type EpErrorCode, type EpError, type EpErrorDetail, type EpUnboundResponderDetail, type EpUnansweredDetail, type EpRegistryReadFailedDetail, type EpNoLiveInstancesDetail, type EpUndeclaredArgDetail, type EpBindRefusedDetail, type EpLifecycleBlockedDetail, type LifecycleBlockedFacts, type EpSeatCapDetail, type SeatCapFacts, type LifecycleBlockedOp, type LifecycleHeadState, type LifecycleGateState, type EpEffectOutcome } from "./endpoint-error.js";
|
|
@@ -136,8 +136,9 @@ export declare function parseEndpointRequest(raw: unknown): EndpointRequest;
|
|
|
136
136
|
* `handle` mode, subject-equal actor + lifecycleUid) for the targeted forms; `from.id` MUST
|
|
137
137
|
* equal the subject sender principal (`sender-mismatch`). Currency of `target.actor`/
|
|
138
138
|
* `target.lifecycleUid` against the live mapping is the handler's fresh-read (`expired`),
|
|
139
|
-
* deliberately not checkable here.
|
|
140
|
-
|
|
139
|
+
* deliberately not checkable here. On the principal route (SPEC 13.21) the body carries no
|
|
140
|
+
* target (`target-mismatch`) and no bind (`bad-request`), and a deadline is required. */
|
|
141
|
+
export declare function checkRequestSubjectAgreement(env: EndpointRequest, subject: ParsedEpRequest | ParsedEpPrincipalRequest): void;
|
|
141
142
|
/** The contract-class agreement check (`class-mismatch`): the envelope's declared class MUST
|
|
142
143
|
* equal the command's contract class. Split out because it needs the contract in hand. */
|
|
143
144
|
export declare function assertClassMatches(env: EndpointRequest, declaredClass: EpClass): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-envelope.d.ts","sourceRoot":"","sources":["../src/endpoint-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAE1F,OAAO,EAA0E,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoint-envelope.d.ts","sourceRoot":"","sources":["../src/endpoint-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAE1F,OAAO,EAA0E,KAAK,wBAAwB,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErK,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI5D,OAAO,EAAkB,eAAe,EAA4C,KAAK,OAAO,EAA4C,MAAM,qBAAqB,CAAC;AACxK,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,KAAK,0BAA0B,E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