@cotal-ai/manager 0.16.0 → 0.18.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/README.md +2 -1
- package/dist/attach-endpoint.d.ts +53 -59
- package/dist/attach-endpoint.d.ts.map +1 -1
- package/dist/attach-endpoint.js +120 -244
- package/dist/attach-endpoint.js.map +1 -1
- package/dist/commands.js +88 -8
- package/dist/commands.js.map +1 -1
- package/dist/console/app.js +68 -30
- package/dist/console/index.html +3 -2
- package/dist/console/session-bundle.js +9736 -0
- package/dist/console-crypto-shim.d.ts +16 -0
- package/dist/console-crypto-shim.d.ts.map +1 -0
- package/dist/console-crypto-shim.js +20 -0
- package/dist/console-crypto-shim.js.map +1 -0
- package/dist/console-session-entry.d.ts +2 -0
- package/dist/console-session-entry.d.ts.map +1 -0
- package/dist/console-session-entry.js +26 -0
- package/dist/console-session-entry.js.map +1 -0
- package/dist/endpoint-evict.d.ts +29 -0
- package/dist/endpoint-evict.d.ts.map +1 -0
- package/dist/endpoint-evict.js +80 -0
- package/dist/endpoint-evict.js.map +1 -0
- package/dist/holder-liveness.d.ts +40 -0
- package/dist/holder-liveness.d.ts.map +1 -0
- package/dist/holder-liveness.js +98 -0
- package/dist/holder-liveness.js.map +1 -0
- package/dist/manager-service-contract.d.ts +132 -0
- package/dist/manager-service-contract.d.ts.map +1 -0
- package/dist/manager-service-contract.js +332 -0
- package/dist/manager-service-contract.js.map +1 -0
- package/dist/manager.d.ts +519 -22
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +2273 -262
- package/dist/manager.js.map +1 -1
- package/dist/reconcile-gate.d.ts +82 -0
- package/dist/reconcile-gate.d.ts.map +1 -0
- package/dist/reconcile-gate.js +118 -0
- package/dist/reconcile-gate.js.map +1 -0
- package/dist/runtime/pty.d.ts.map +1 -1
- package/dist/runtime/pty.js +15 -2
- package/dist/runtime/pty.js.map +1 -1
- package/dist/session/bridge.d.ts +63 -0
- package/dist/session/bridge.d.ts.map +1 -0
- package/dist/session/bridge.js +157 -0
- package/dist/session/bridge.js.map +1 -0
- package/dist/session/establish.d.ts +212 -0
- package/dist/session/establish.d.ts.map +1 -0
- package/dist/session/establish.js +174 -0
- package/dist/session/establish.js.map +1 -0
- package/dist/session/index.d.ts +12 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +15 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/plane.d.ts +120 -0
- package/dist/session/plane.d.ts.map +1 -0
- package/dist/session/plane.js +327 -0
- package/dist/session/plane.js.map +1 -0
- package/dist/static-lifecycle.d.ts +97 -0
- package/dist/static-lifecycle.d.ts.map +1 -0
- package/dist/static-lifecycle.js +262 -0
- package/dist/static-lifecycle.js.map +1 -0
- package/package.json +10 -6
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The STATIC §13.1 lifecycle executor (Unit B): the manager-side adapter that drives the ONE
|
|
3
|
+
* shared core saga (`@cotal-ai/core` lifecycle-saga) over a direct-KV
|
|
4
|
+
* {@link LifecycleStateTransport}, plus the static executor's OWN orchestration — the durable
|
|
5
|
+
* slot mapping (F3 outer spawn intent + the F5-bind alias -> (owner, actor, uid) join), the
|
|
6
|
+
* static credential-ledger rows, and the F1 terminal sequence.
|
|
7
|
+
*
|
|
8
|
+
* Three-way split (the Unit B design note, panel-locked): the key/value GRAMMAR lives in core
|
|
9
|
+
* `lifecycle-state.ts`; the CAS SEQUENCING is the shared core saga this module DELEGATES to
|
|
10
|
+
* (never a hand-ordered local copy); the barrier ORCHESTRATION here is the static executor's
|
|
11
|
+
* own (revoke from the slot's recorded credentialIds, best-effort eviction = the child process
|
|
12
|
+
* kill the manager already did, footprint cleanup via the manager's deprovision hooks).
|
|
13
|
+
*
|
|
14
|
+
* F5-bind (the F4 restatement): the wire AUTHORITY coordinate is the incarnation-unique nkey
|
|
15
|
+
* (`actor`); the ALIAS is routing only, protected by the name-keyed slot row + uid reservation +
|
|
16
|
+
* the manager's freeSlot hold — never by the head CAS alone (the head is principal-keyed).
|
|
17
|
+
*/
|
|
18
|
+
import { EpEnvelopeError, staticSlotKey, parseStaticSlotRow, credRowKey, parseLedgerRow, SOURCE_ROOT, createRecordEntry, updateRecordEntry, runActivationSagaAtUid, resumeActivationSaga, gateObserve, gateFreeze, gateRetire, headCandidate, headBeginRetirement, headCompleteRetirement, } from "@cotal-ai/core";
|
|
19
|
+
const enc = new TextEncoder();
|
|
20
|
+
/** The direct-KV transport over the two authority stores, bound per lifecycle OPERATION on an
|
|
21
|
+
* ephemeral, key-pinned `lifecycle-executor` connection (the manager mints it; see
|
|
22
|
+
* `withLifecycleExecutor`). Mirrors the auth implementation's sealed `transportOf` — a
|
|
23
|
+
* transport carries no sequencing decisions of its own. */
|
|
24
|
+
export function staticLifecycleTransport(recordsKv, authKv) {
|
|
25
|
+
const entryOf = (e) => e === null ? undefined : { value: e.value, revision: e.revision, operation: e.operation };
|
|
26
|
+
return {
|
|
27
|
+
getRecord: async (key) => entryOf(await recordsKv.get(key)),
|
|
28
|
+
createRecord: (key, value) => createRecordEntry(recordsKv, key, value),
|
|
29
|
+
updateRecord: (key, value, rev) => updateRecordEntry(recordsKv, key, value, rev),
|
|
30
|
+
getAuth: async (key) => entryOf(await authKv.get(key)),
|
|
31
|
+
putAuth: (key, payload, rev) => authKv.put(key, payload, { previousSeq: rev }),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Read one slot row (DEL/PURGE marker = corruption, never absence — supervision state is
|
|
35
|
+
* CASed over, never deleted). */
|
|
36
|
+
export async function readStaticSlot(t, owner, alias) {
|
|
37
|
+
const key = staticSlotKey(owner, alias);
|
|
38
|
+
const entry = await t.getRecord(key);
|
|
39
|
+
if (!entry)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (entry.operation !== "PUT")
|
|
42
|
+
throw new EpEnvelopeError("failed-precondition", `the static slot row ${key} carries a ${entry.operation} marker; a slot row is never deleted (corruption, not absence)`);
|
|
43
|
+
return { row: parseStaticSlotRow(entry.value, key), revision: entry.revision };
|
|
44
|
+
}
|
|
45
|
+
/** Persist the F3 durable OUTER spawn intent — phase `provisioning`, written BEFORE the head
|
|
46
|
+
* activation so a crash between them leaves a discoverable coordinate (the boot sweep or the
|
|
47
|
+
* next same-alias spawn re-drives it). Create-only for a virgin alias; a CAS over the RETIRED
|
|
48
|
+
* predecessor row for a reused alias; anything else is a live/terminalizing/crashed slot and
|
|
49
|
+
* REFUSES loudly (the caller resolves it first — resume or terminal, never silent adoption). */
|
|
50
|
+
export async function writeStaticSlotIntent(t, row) {
|
|
51
|
+
const key = staticSlotKey(row.owner, row.alias);
|
|
52
|
+
const intent = { ...row, phase: "provisioning", credentialIds: [] };
|
|
53
|
+
const existing = await readStaticSlot(t, row.owner, row.alias);
|
|
54
|
+
if (existing === undefined)
|
|
55
|
+
return { revision: await t.createRecord(key, intent) };
|
|
56
|
+
if (existing.row.phase !== "retired")
|
|
57
|
+
throw new EpEnvelopeError("failed-precondition", `the static slot for "${row.owner}/${row.alias}" is ${existing.row.phase} at uid ${existing.row.lifecycleUid}; a new spawn intent may only replace a RETIRED slot - resolve the standing slot first (resume its provisioning or drive its terminal)`);
|
|
58
|
+
return { revision: await t.updateRecord(key, intent, existing.revision) };
|
|
59
|
+
}
|
|
60
|
+
/** CAS a slot row to a new phase/content at its observed revision. */
|
|
61
|
+
export async function casStaticSlot(t, row, revision) {
|
|
62
|
+
return t.updateRecord(staticSlotKey(row.owner, row.alias), row, revision);
|
|
63
|
+
}
|
|
64
|
+
/** Record a credentialId on the slot BEFORE its ledger row is appended and BEFORE the cred is
|
|
65
|
+
* minted (the crash-safe order: slot record -> ledger row -> mint/write; a credential never
|
|
66
|
+
* exists without its id recorded and its row appended first). */
|
|
67
|
+
export async function recordSlotCredential(t, owner, alias, lifecycleUid, credentialId) {
|
|
68
|
+
const slot = await readStaticSlot(t, owner, alias);
|
|
69
|
+
if (slot === undefined || slot.row.lifecycleUid !== lifecycleUid)
|
|
70
|
+
throw new EpEnvelopeError("failed-precondition", `the static slot for "${owner}/${alias}" ${slot === undefined ? "does not exist" : `is at uid ${slot.row.lifecycleUid}`}, not uid ${lifecycleUid}; a credential is recorded only on its own incarnation's slot`);
|
|
71
|
+
if (slot.row.phase === "terminalizing" || slot.row.phase === "retired")
|
|
72
|
+
throw new EpEnvelopeError("failed-precondition", `the static slot for "${owner}/${alias}" is ${slot.row.phase}; no credential is minted after terminalizing (F5(b))`);
|
|
73
|
+
if (slot.row.credentialIds.includes(credentialId))
|
|
74
|
+
return; // crash-resume idempotence
|
|
75
|
+
await casStaticSlot(t, { ...slot.row, credentialIds: [...slot.row.credentialIds, credentialId] }, slot.revision);
|
|
76
|
+
}
|
|
77
|
+
/** Append this incarnation's credential-ledger row (`cred.<uid>.<credId>`, state `active`,
|
|
78
|
+
* lineage `root` — the manager's seed IS the root authority in static mode). Create-only;
|
|
79
|
+
* an existing SAME row is crash-resume idempotence, anything else refuses. */
|
|
80
|
+
export async function appendStaticCredentialRow(t, args) {
|
|
81
|
+
const key = credRowKey(args.lifecycleUid, args.credentialId);
|
|
82
|
+
const row = {
|
|
83
|
+
credentialId: args.credentialId,
|
|
84
|
+
holderPrincipal: args.holderPrincipal,
|
|
85
|
+
lifecycleUid: args.lifecycleUid,
|
|
86
|
+
sourceChain: [SOURCE_ROOT],
|
|
87
|
+
state: "active",
|
|
88
|
+
exp: args.exp,
|
|
89
|
+
};
|
|
90
|
+
const existing = await t.getAuth(key);
|
|
91
|
+
if (existing !== undefined) {
|
|
92
|
+
if (existing.operation !== "PUT")
|
|
93
|
+
throw new EpEnvelopeError("failed-precondition", `the ledger row ${key} carries a ${existing.operation} marker; a ledger row is never deleted (SPEC 13.12)`);
|
|
94
|
+
const cur = parseLedgerRow(existing.value, key);
|
|
95
|
+
if (cur.holderPrincipal === args.holderPrincipal && cur.state === "active")
|
|
96
|
+
return; // our own crash-resume
|
|
97
|
+
throw new EpEnvelopeError("already-exists", `the ledger row ${key} already exists (holder ${cur.holderPrincipal}, state ${cur.state}); a credentialId is never re-issued (SPEC 13.1)`);
|
|
98
|
+
}
|
|
99
|
+
await t.putAuth(key, enc.encode(JSON.stringify(row)), 0);
|
|
100
|
+
}
|
|
101
|
+
/** The static terminal's B1 revoke: CAS every recorded row `active -> revoked`. Enumeration is
|
|
102
|
+
* the SLOT's recorded credentialIds (recorded before every mint), never a store listing. An
|
|
103
|
+
* ABSENT row is the legitimate crash window (id recorded, mint never reached) — no credential
|
|
104
|
+
* exists for it, logged and skipped; a revoked row is idempotence. */
|
|
105
|
+
export async function revokeStaticCredentialRows(t, lifecycleUid, credentialIds, log) {
|
|
106
|
+
for (const id of credentialIds) {
|
|
107
|
+
const key = credRowKey(lifecycleUid, id);
|
|
108
|
+
const entry = await t.getAuth(key);
|
|
109
|
+
if (entry === undefined) {
|
|
110
|
+
log(`ledger row ${key} absent at revoke: the id was recorded but its mint never completed (crash window); no credential exists for it`);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (entry.operation !== "PUT")
|
|
114
|
+
throw new EpEnvelopeError("failed-precondition", `the ledger row ${key} carries a ${entry.operation} marker; a ledger row is never deleted (SPEC 13.12)`);
|
|
115
|
+
const row = parseLedgerRow(entry.value, key);
|
|
116
|
+
if (row.state === "revoked")
|
|
117
|
+
continue;
|
|
118
|
+
await t.putAuth(key, enc.encode(JSON.stringify({ ...row, state: "revoked" })), entry.revision);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** The static ACTIVATION: F3 intent FIRST (durable outer spawn intent, phase `provisioning`),
|
|
122
|
+
* then the SHARED core activation saga at the spawn's uid (reserve -> gate frozen -> head CAS
|
|
123
|
+
* -> reopen LAST). Returns the slot revision the spawn path later CASes to `active` once the
|
|
124
|
+
* managed row owns the slot. */
|
|
125
|
+
export async function activateStaticLifecycle(t, args) {
|
|
126
|
+
const { revision } = await writeStaticSlotIntent(t, {
|
|
127
|
+
owner: args.owner,
|
|
128
|
+
alias: args.alias,
|
|
129
|
+
actor: args.actor,
|
|
130
|
+
lifecycleUid: args.lifecycleUid,
|
|
131
|
+
managerInstance: args.managerInstance,
|
|
132
|
+
ownerInstanceId: args.ownerInstanceId,
|
|
133
|
+
});
|
|
134
|
+
await runActivationSagaAtUid(t, { owner: args.owner, actor: args.actor, lifecycleUid: args.lifecycleUid, managerInstance: args.managerInstance });
|
|
135
|
+
return { slotRevision: revision };
|
|
136
|
+
}
|
|
137
|
+
/** The static TERMINAL (F1, the (b2) order): freeze-under-the-retirement-op -> head
|
|
138
|
+
* `active -> retiring` -> B1 ledger revoke -> cleanup (the injected footprint teardown; the
|
|
139
|
+
* process kill — static "eviction" — already happened on the manager's stop path) -> gate
|
|
140
|
+
* `frozen -> retired` -> head `retiring -> retired` LAST -> slot `retired` (the alias frees).
|
|
141
|
+
* Every gate/head step DELEGATES to the shared core saga; recovery recognizes a SAME-OP
|
|
142
|
+
* terminal gate and finishes the head (the lost-ack alias wedge the panel closed).
|
|
143
|
+
*
|
|
144
|
+
* Total over partial durable state: an alias whose activation never reached the saga (slot
|
|
145
|
+
* `provisioning`, no gate) terminalizes by slot alone; a crashed activation frozen by its own
|
|
146
|
+
* activation op is terminalized THROUGH that op (gateRetire is op-pinned) — the exact-op static
|
|
147
|
+
* retirement F3 requires. */
|
|
148
|
+
export async function runStaticTerminal(t, args, hooks) {
|
|
149
|
+
const slot = await readStaticSlot(t, args.owner, args.alias);
|
|
150
|
+
if (slot === undefined)
|
|
151
|
+
throw new EpEnvelopeError("failed-precondition", `no static slot exists for "${args.owner}/${args.alias}"; nothing to terminalize`);
|
|
152
|
+
if (slot.row.lifecycleUid !== args.lifecycleUid)
|
|
153
|
+
throw new EpEnvelopeError("failed-precondition", `the static slot for "${args.owner}/${args.alias}" is at uid ${slot.row.lifecycleUid}, not ${args.lifecycleUid}; a terminal never addresses another incarnation (SPEC 13.1)`);
|
|
154
|
+
if (slot.row.phase === "retired")
|
|
155
|
+
return "retired"; // completed terminal, idempotent
|
|
156
|
+
// Latch the DURABLE terminal intent first: after this CAS the slot can never mint again
|
|
157
|
+
// (recordSlotCredential refuses terminalizing), the exact window the F5 renewal gate needs.
|
|
158
|
+
let slotRevision = slot.revision;
|
|
159
|
+
if (slot.row.phase !== "terminalizing")
|
|
160
|
+
slotRevision = await casStaticSlot(t, { ...slot.row, phase: "terminalizing" }, slot.revision);
|
|
161
|
+
const gate = await gateObserve(t, args.lifecycleUid);
|
|
162
|
+
if (gate === undefined) {
|
|
163
|
+
// Crash before the saga's first durable write (or before gate creation): only the intent
|
|
164
|
+
// (and possibly the burned uid reservation) exists. No head to retire; settle the slot.
|
|
165
|
+
const head = await headCandidate(t, args.owner, args.actor);
|
|
166
|
+
if (head !== undefined && head.mapping.lifecycleUid === args.lifecycleUid)
|
|
167
|
+
throw new EpEnvelopeError("internal", `the head for "${args.owner}/${args.actor}" names uid ${args.lifecycleUid} but its gate does not exist; an active head without a gate is corruption (SPEC 13.1)`);
|
|
168
|
+
await revokeStaticCredentialRows(t, args.lifecycleUid, slot.row.credentialIds, hooks.log);
|
|
169
|
+
await hooks.cleanup();
|
|
170
|
+
await casStaticSlot(t, { ...slot.row, phase: "retired" }, slotRevision);
|
|
171
|
+
return "retired";
|
|
172
|
+
}
|
|
173
|
+
if (gate.row.state === "frozen" && gate.row.op?.kind === "activation") {
|
|
174
|
+
// A crashed ACTIVATION. Two durable shapes, decided by the head (§13.1: the saga writes the
|
|
175
|
+
// head BEFORE its reopen):
|
|
176
|
+
const head = await headCandidate(t, args.owner, args.actor);
|
|
177
|
+
if (head !== undefined && head.mapping.state === "active" && head.mapping.lifecycleUid === args.lifecycleUid) {
|
|
178
|
+
// The head won; only the reopen is missing. FINISH the activation under ITS OWN op (the
|
|
179
|
+
// shared resume), then retire the now-live lifecycle normally below.
|
|
180
|
+
await resumeActivationSaga(t, { owner: args.owner, actor: args.actor, lifecycleUid: args.lifecycleUid, opId: gate.row.op.opId });
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// The head never won: burn the uid THROUGH the activation's own op (op-pinned exact-op
|
|
184
|
+
// static retirement), then settle the slot — there is no head to retire.
|
|
185
|
+
await gateRetire(t, { lifecycleUid: args.lifecycleUid, revision: gate.revision, opId: gate.row.op.opId });
|
|
186
|
+
await revokeStaticCredentialRows(t, args.lifecycleUid, slot.row.credentialIds, hooks.log);
|
|
187
|
+
await hooks.cleanup();
|
|
188
|
+
const cur = await readStaticSlot(t, args.owner, args.alias);
|
|
189
|
+
if (cur !== undefined && cur.row.lifecycleUid === args.lifecycleUid && cur.row.phase !== "retired")
|
|
190
|
+
await casStaticSlot(t, { ...cur.row, phase: "retired" }, cur.revision);
|
|
191
|
+
return "retired";
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else if (gate.row.state === "frozen" && gate.row.op?.kind !== "retirement") {
|
|
195
|
+
throw new EpEnvelopeError("failed-precondition", `the issuance gate for ${args.lifecycleUid} is frozen by a ${gate.row.op?.kind ?? "<unknown>"} (op ${gate.row.op?.opId ?? "<none>"}); a foreign barrier is in flight - refuse (SPEC 13.1)`);
|
|
196
|
+
}
|
|
197
|
+
else if (gate.row.state === "frozen" && gate.row.op?.opId !== args.opId) {
|
|
198
|
+
throw new EpEnvelopeError("failed-precondition", `the issuance gate for ${args.lifecycleUid} is frozen by retirement op ${gate.row.op?.opId ?? "<none>"}, not ${args.opId}; one retirement at a time (SPEC 13.1)`);
|
|
199
|
+
}
|
|
200
|
+
// Freeze under OUR retirement op if the gate is open (fresh terminal, or the just-finished
|
|
201
|
+
// activation resume). A gate frozen by our op (crash-resume) or already terminal (same-op
|
|
202
|
+
// recovery, verified below) passes through.
|
|
203
|
+
const gAfter = await gateObserve(t, args.lifecycleUid);
|
|
204
|
+
if (gAfter === undefined)
|
|
205
|
+
throw new EpEnvelopeError("internal", `the issuance gate for ${args.lifecycleUid} vanished mid-terminal; a gate is never deleted (SPEC 13.12)`);
|
|
206
|
+
if (gAfter.row.state === "open")
|
|
207
|
+
await gateFreeze(t, { lifecycleUid: args.lifecycleUid, revision: gAfter.revision, op: { opId: args.opId, kind: "retirement" } });
|
|
208
|
+
// Head containment: `active -> retiring` under our op (idempotent for our own crash-resume;
|
|
209
|
+
// a foreign uid or a foreign retiring op refuses inside the shared step).
|
|
210
|
+
const headNow = await headCandidate(t, args.owner, args.actor);
|
|
211
|
+
if (headNow === undefined)
|
|
212
|
+
throw new EpEnvelopeError("internal", `the head for "${args.owner}/${args.actor}" is absent while its gate exists past activation; corruption (SPEC 13.1)`);
|
|
213
|
+
if (headNow.mapping.lifecycleUid !== args.lifecycleUid)
|
|
214
|
+
throw new EpEnvelopeError("failed-precondition", `the head for "${args.owner}/${args.actor}" names uid ${headNow.mapping.lifecycleUid}, not ${args.lifecycleUid}; foreign movement - refuse (SPEC 13.1)`);
|
|
215
|
+
if (headNow.mapping.state !== "retired")
|
|
216
|
+
await headBeginRetirement(t, { owner: args.owner, actor: args.actor, lifecycleUid: args.lifecycleUid, opId: args.opId });
|
|
217
|
+
await revokeStaticCredentialRows(t, args.lifecycleUid, slot.row.credentialIds, hooks.log);
|
|
218
|
+
await hooks.cleanup();
|
|
219
|
+
// The terminal tail, in the (b2) order: gate frozen->retired FIRST (retains the opId, the
|
|
220
|
+
// recovery coordinate), head retiring->retired LAST (drops the op; the alias frees only now).
|
|
221
|
+
// gateRetire is called UNCONDITIONALLY: on a frozen gate it terminalizes; on an already-retired
|
|
222
|
+
// gate it is SAME-OP idempotent and refuses a foreign terminal (the op-pin is the verification).
|
|
223
|
+
const gNow = await gateObserve(t, args.lifecycleUid);
|
|
224
|
+
if (gNow === undefined)
|
|
225
|
+
throw new EpEnvelopeError("internal", `the issuance gate for ${args.lifecycleUid} vanished mid-terminal; a gate is never deleted (SPEC 13.12)`);
|
|
226
|
+
await gateRetire(t, { lifecycleUid: args.lifecycleUid, revision: gNow.revision, opId: args.opId });
|
|
227
|
+
const head = await headCandidate(t, args.owner, args.actor);
|
|
228
|
+
if (head !== undefined && head.mapping.lifecycleUid === args.lifecycleUid && head.mapping.state !== "retired")
|
|
229
|
+
await headCompleteRetirement(t, { owner: args.owner, actor: args.actor, lifecycleUid: args.lifecycleUid, opId: args.opId });
|
|
230
|
+
const cur = await readStaticSlot(t, args.owner, args.alias);
|
|
231
|
+
if (cur === undefined)
|
|
232
|
+
throw new EpEnvelopeError("internal", `the static slot for "${args.owner}/${args.alias}" vanished mid-terminal; a slot row is never deleted`);
|
|
233
|
+
if (cur.row.lifecycleUid === args.lifecycleUid && cur.row.phase !== "retired")
|
|
234
|
+
await casStaticSlot(t, { ...cur.row, phase: "retired" }, cur.revision);
|
|
235
|
+
return "retired";
|
|
236
|
+
}
|
|
237
|
+
/** The boot-sweep resume decision, TOTAL over the phase enum (F3): what the manager must do
|
|
238
|
+
* with a durable slot it did not adopt from a live inventory. */
|
|
239
|
+
export function planStaticSlotResume(row, adopted) {
|
|
240
|
+
switch (row.phase) {
|
|
241
|
+
case "retired":
|
|
242
|
+
return "none";
|
|
243
|
+
case "provisioning":
|
|
244
|
+
case "terminalizing":
|
|
245
|
+
// A crashed spawn (its process never joined) or a crashed terminal: both re-drive the
|
|
246
|
+
// exact-op terminal (runStaticTerminal is total over the partial durable states).
|
|
247
|
+
return "drive-terminal";
|
|
248
|
+
case "active":
|
|
249
|
+
// `adopted` is genuine live membership (the manager holds this incarnation as a managed
|
|
250
|
+
// agent). Adopted -> the live process owns it, leave it. NOT adopted -> the process is gone
|
|
251
|
+
// (a non-preserving restart, or an orphan the resume did not claim): the incarnation is
|
|
252
|
+
// dead, terminalize. The CALLER supplies `adopted` correctly per sweep: a boot sweep with a
|
|
253
|
+
// resume pending DEFERS active slots (adoption has not run yet) rather than passing a false
|
|
254
|
+
// adopted; the post-adoption sweep passes true membership.
|
|
255
|
+
return adopted ? "none" : "drive-terminal";
|
|
256
|
+
default: {
|
|
257
|
+
const never = row.phase;
|
|
258
|
+
throw new EpEnvelopeError("internal", `unhandled static slot phase ${String(never)}; the resume table is total by construction (F3)`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=static-lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-lifecycle.js","sourceRoot":"","sources":["../src/static-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,eAAe,EAMf,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B;;;4DAG4D;AAC5D,MAAM,UAAU,wBAAwB,CAAC,SAAa,EAAE,MAAU;IAChE,MAAM,OAAO,GAAG,CAAC,CAAoE,EAAgC,EAAE,CACrH,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;IAC5F,OAAO;QACL,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3D,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC;QACtE,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC;QAChF,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,OA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CAAC;IAChJ,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS;QAC3E,MAAM,aAAa,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;kEACkE;AAClE,MAAM,UAAU,oBAAoB,CAAC,GAAyB,EAAE,OAAgB;IAC9E,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,cAAc,CAAC;QACpB,KAAK,eAAe;YAClB,sFAAsF;YACtF,kFAAkF;YAClF,OAAO,gBAAgB,CAAC;QAC1B,KAAK,QAAQ;YACX,wFAAwF;YACxF,4FAA4F;YAC5F,wFAAwF;YACxF,4FAA4F;YAC5F,4FAA4F;YAC5F,2DAA2D;YAC3D,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC;QAC7C,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,KAAK,GAAU,GAAG,CAAC,KAAK,CAAC;YAC/B,MAAM,IAAI,eAAe,CAAC,UAAU,EAAE,+BAA+B,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACxI,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/manager",
|
|
3
|
-
"description": "Cotal agent supervisor: spawns and manages mesh nodes via a pluggable runtime (pty/tmux/cmux/orca).",
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Cotal agent supervisor: spawns and manages mesh nodes via a pluggable runtime (pty/tmux/cmux/orca/herdr).",
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,14 +27,17 @@
|
|
|
27
27
|
"ws": "^8.21.0",
|
|
28
28
|
"yaml": "^2.9.0",
|
|
29
29
|
"zod": "^4.4.3",
|
|
30
|
-
"@cotal-ai/
|
|
31
|
-
"@cotal-ai/
|
|
30
|
+
"@cotal-ai/core": "0.18.0",
|
|
31
|
+
"@cotal-ai/workspace": "0.18.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@nats-io/jetstream": "^3.4.0",
|
|
35
|
+
"@nats-io/kv": "^3.4.0",
|
|
36
|
+
"@nats-io/nats-core": "^3.4.0",
|
|
35
37
|
"@nats-io/transport-node": "^3.4.0",
|
|
36
38
|
"@types/ws": "^8.18.1",
|
|
37
|
-
"
|
|
39
|
+
"esbuild": "^0.28.1",
|
|
40
|
+
"@cotal-ai/connector-core": "0.18.0"
|
|
38
41
|
},
|
|
39
42
|
"files": [
|
|
40
43
|
"dist"
|
|
@@ -45,6 +48,7 @@
|
|
|
45
48
|
"scripts": {
|
|
46
49
|
"test": "tsx smoke/start-model-preflight.smoke.ts && tsx smoke/start-overrides.smoke.ts && tsx smoke/preserve-state.smoke.ts",
|
|
47
50
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
48
|
-
"build": "tsc -p tsconfig.json && node -e \"const fs=require('node:fs'); fs.rmSync('dist/console', { recursive: true, force: true }); fs.cpSync('src/console', 'dist/console', { recursive: true })\""
|
|
51
|
+
"build": "tsc -p tsconfig.json && node -e \"const fs=require('node:fs'); fs.rmSync('dist/console', { recursive: true, force: true }); fs.cpSync('src/console', 'dist/console', { recursive: true })\" && pnpm run build:console-bundle",
|
|
52
|
+
"build:console-bundle": "esbuild src/console-session-entry.ts --bundle --format=iife --platform=browser --target=es2020 --alias:node:crypto=./src/console-crypto-shim.ts --outfile=dist/console/session-bundle.js && node scripts/console-bundle-loadtest.mjs"
|
|
49
53
|
}
|
|
50
54
|
}
|