instar 1.3.366 → 1.3.367
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +200 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +18 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/MeshRpc.d.ts +8 -0
- package/dist/core/MeshRpc.d.ts.map +1 -1
- package/dist/core/MeshRpc.js +6 -1
- package/dist/core/MeshRpc.js.map +1 -1
- package/dist/core/PeerPresencePuller.d.ts +6 -0
- package/dist/core/PeerPresencePuller.d.ts.map +1 -1
- package/dist/core/PeerPresencePuller.js +5 -0
- package/dist/core/PeerPresencePuller.js.map +1 -1
- package/dist/core/PeerVisibilityGuard.d.ts +83 -0
- package/dist/core/PeerVisibilityGuard.d.ts.map +1 -0
- package/dist/core/PeerVisibilityGuard.js +204 -0
- package/dist/core/PeerVisibilityGuard.js.map +1 -0
- package/dist/core/PendingPullLedger.d.ts +129 -0
- package/dist/core/PendingPullLedger.d.ts.map +1 -0
- package/dist/core/PendingPullLedger.js +239 -0
- package/dist/core/PendingPullLedger.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +20 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/WorkingSetManifest.d.ts +2 -0
- package/dist/core/WorkingSetManifest.d.ts.map +1 -1
- package/dist/core/WorkingSetManifest.js +13 -1
- package/dist/core/WorkingSetManifest.js.map +1 -1
- package/dist/core/WorkingSetPull.d.ts +157 -0
- package/dist/core/WorkingSetPull.d.ts.map +1 -0
- package/dist/core/WorkingSetPull.js +546 -0
- package/dist/core/WorkingSetPull.js.map +1 -0
- package/dist/core/WorkingSetPullCoordinator.d.ts +134 -0
- package/dist/core/WorkingSetPullCoordinator.d.ts.map +1 -0
- package/dist/core/WorkingSetPullCoordinator.js +306 -0
- package/dist/core/WorkingSetPullCoordinator.js.map +1 -0
- package/dist/core/types.d.ts +26 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +4 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts +3 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +1 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/routes.d.ts +5 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +24 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +64 -64
- package/src/data/state-coherence-registry.json +48 -12
- package/src/scaffold/templates.ts +4 -0
- package/upgrades/1.3.367.md +134 -0
- package/upgrades/side-effects/working-set-ci-absorb.md +29 -0
- package/upgrades/side-effects/working-set-parity-absorb.md +35 -0
- package/upgrades/side-effects/working-set-pull-p22a.md +121 -0
- package/upgrades/side-effects/working-set-trigger-p22b.md +115 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAo6StE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -2352,6 +2352,17 @@ export async function startServer(options) {
|
|
|
2352
2352
|
// RECEIVE handler (always-registered; harmless when idle) and the
|
|
2353
2353
|
// REPLICATION-GATED puller delta drive. Constructed only when the journal is.
|
|
2354
2354
|
let journalSyncApplier;
|
|
2355
|
+
// Working-set serve side (WORKING-SET-HANDOFF-SPEC §3.7): constructed ONLY
|
|
2356
|
+
// when replication is EXPLICITLY enabled (=== true, never the dark-ship
|
|
2357
|
+
// gate) — the pull is meaningless without replication's mesh path and must
|
|
2358
|
+
// never out-activate it. The dispatcher's working-set-pull handler answers
|
|
2359
|
+
// 'disabled' while this stays undefined.
|
|
2360
|
+
let workingSetPullServer;
|
|
2361
|
+
// The pull side (§3.3 trigger + §3.4 ledger/drain + the reflex route).
|
|
2362
|
+
// Hoisted here so the deliverMessage onAccepted seam (wired earlier than
|
|
2363
|
+
// the mesh client) can reference it lazily; constructed in the mesh-wiring
|
|
2364
|
+
// block ONLY under the same explicit replication gate.
|
|
2365
|
+
let workingSetPullCoordinator;
|
|
2355
2366
|
{
|
|
2356
2367
|
const cjCfg = config.multiMachine?.coherenceJournal;
|
|
2357
2368
|
const cjEnabled = cjCfg?.enabled ?? !!config.developmentAgent;
|
|
@@ -2397,6 +2408,35 @@ export async function startServer(options) {
|
|
|
2397
2408
|
journalSyncApplier = undefined;
|
|
2398
2409
|
console.log(pc.dim(` [journal-sync] applier not constructed: ${e instanceof Error ? e.message : String(e)}`));
|
|
2399
2410
|
}
|
|
2411
|
+
// Working-set serve side (WORKING-SET-HANDOFF-SPEC §3.2/§3.7) —
|
|
2412
|
+
// gated on the EXPLICIT replication enable, same gate as the
|
|
2413
|
+
// replication SEND/drive below. Serves OWN jailed working files
|
|
2414
|
+
// behind a fresh-manifest allowlist; chunked ≤ pullMaxBatchBytes.
|
|
2415
|
+
if (cjCfg?.replication?.enabled === true) {
|
|
2416
|
+
try {
|
|
2417
|
+
const wsMod = await import('../core/WorkingSetPull.js');
|
|
2418
|
+
const wsReaderMod = await import('../core/CoherenceJournalReader.js');
|
|
2419
|
+
const wsReader = new wsReaderMod.CoherenceJournalReader({ stateDir: config.stateDir });
|
|
2420
|
+
const ws = cjCfg?.workingSet;
|
|
2421
|
+
workingSetPullServer = new wsMod.WorkingSetPullServer({
|
|
2422
|
+
stateDir: config.stateDir,
|
|
2423
|
+
readRuns: (topic) => wsReader.readOwnAutonomousRuns(topic, cjMachineId),
|
|
2424
|
+
caps: {
|
|
2425
|
+
...(ws?.maxFileBytes != null ? { maxFileBytes: ws.maxFileBytes } : {}),
|
|
2426
|
+
...(ws?.headlineFileBytes != null ? { headlineFileBytes: ws.headlineFileBytes } : {}),
|
|
2427
|
+
...(ws?.maxFiles != null ? { maxFiles: ws.maxFiles } : {}),
|
|
2428
|
+
...(ws?.maxTotalBytes != null ? { maxTotalBytes: ws.maxTotalBytes } : {}),
|
|
2429
|
+
},
|
|
2430
|
+
...(ws?.pullMaxBatchBytes != null ? { pullMaxBatchBytes: ws.pullMaxBatchBytes } : {}),
|
|
2431
|
+
...(ws?.serveConcurrency != null ? { serveConcurrency: ws.serveConcurrency } : {}),
|
|
2432
|
+
logger: (m) => console.log(pc.dim(` [working-set] ${m}`)),
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2435
|
+
catch (e) { /* @silent-fallback-ok: working-set serve construction failure degrades to 'disabled' responses — never blocks server boot (WORKING-SET-HANDOFF-SPEC §4) */
|
|
2436
|
+
workingSetPullServer = undefined;
|
|
2437
|
+
console.log(pc.dim(` [working-set] serve side not constructed: ${e instanceof Error ? e.message : String(e)}`));
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2400
2440
|
// §3.3 autonomous-run journal scanner — observation-based start/stop
|
|
2401
2441
|
// (no single .local.md write funnel exists; polling is the structural
|
|
2402
2442
|
// choice). P19 brakes, declared: constant per-tick cost (bounded by
|
|
@@ -9706,6 +9746,13 @@ export async function startServer(options) {
|
|
|
9706
9746
|
// double-gate on stage!=='dark' to be safe. Fire-and-forget: the durable receipt
|
|
9707
9747
|
// is already recorded + ACKed before this runs.
|
|
9708
9748
|
onAccepted: (cmd) => {
|
|
9749
|
+
// Working-set move trigger (WORKING-SET-HANDOFF §3.3) — fire-and-forget,
|
|
9750
|
+
// BEFORE the stage gate (the coordinator carries its own gates; dark ⇒ undefined).
|
|
9751
|
+
{
|
|
9752
|
+
const wsTopic = Number(cmd.session);
|
|
9753
|
+
if (Number.isFinite(wsTopic))
|
|
9754
|
+
workingSetPullCoordinator?.onTopicAccepted(wsTopic);
|
|
9755
|
+
}
|
|
9709
9756
|
if (_sessionPoolStage() === 'dark' || !telegram)
|
|
9710
9757
|
return;
|
|
9711
9758
|
const tg = telegram;
|
|
@@ -9872,6 +9919,16 @@ export async function startServer(options) {
|
|
|
9872
9919
|
}
|
|
9873
9920
|
return { ok: true };
|
|
9874
9921
|
},
|
|
9922
|
+
// WORKING-SET-HANDOFF-SPEC §3.2 — the chunked working-set serve
|
|
9923
|
+
// verb. Registered always (lockstep with the union+RBAC edits so
|
|
9924
|
+
// a mixed-version caller gets a clean answer, never no-handler
|
|
9925
|
+
// surprises within one version); answers 'disabled' until the
|
|
9926
|
+
// §3.7 replication gate constructs the serve side above.
|
|
9927
|
+
'working-set-pull': (cmd) => {
|
|
9928
|
+
if (!workingSetPullServer)
|
|
9929
|
+
return { ok: false, reason: 'working-set disabled' };
|
|
9930
|
+
return workingSetPullServer.handle(cmd);
|
|
9931
|
+
},
|
|
9875
9932
|
place: ownAction,
|
|
9876
9933
|
claim: ownAction,
|
|
9877
9934
|
transfer: ownAction,
|
|
@@ -9959,6 +10016,147 @@ export async function startServer(options) {
|
|
|
9959
10016
|
const selfNickTimer = setInterval(() => { void convergeSelfNickname(); }, 60_000);
|
|
9960
10017
|
if (typeof selfNickTimer.unref === 'function')
|
|
9961
10018
|
selfNickTimer.unref();
|
|
10019
|
+
// ── Working-set pull coordinator (WORKING-SET-HANDOFF §3.3/§3.4) ──
|
|
10020
|
+
// Constructed here (after meshClient + peerUrl exist) ONLY when the
|
|
10021
|
+
// serve side was constructed above — i.e. the same explicit
|
|
10022
|
+
// replication.enabled === true gate. Wires the move trigger (the
|
|
10023
|
+
// onAccepted seam reads the hoisted variable), the reflex route, the
|
|
10024
|
+
// returning-peer staggered drain, and the slow sweep tick.
|
|
10025
|
+
if (workingSetPullServer) {
|
|
10026
|
+
try {
|
|
10027
|
+
const wscMod = await import('../core/WorkingSetPullCoordinator.js');
|
|
10028
|
+
const ledgerMod = await import('../core/PendingPullLedger.js');
|
|
10029
|
+
const wsPullMod = await import('../core/WorkingSetPull.js');
|
|
10030
|
+
const wsReaderMod2 = await import('../core/CoherenceJournalReader.js');
|
|
10031
|
+
const wsCfg = config.multiMachine?.coherenceJournal?.workingSet;
|
|
10032
|
+
const wsLedger = new ledgerMod.PendingPullLedger({
|
|
10033
|
+
stateDir: config.stateDir,
|
|
10034
|
+
ttlDays: wsCfg?.pendingPullTtlDays,
|
|
10035
|
+
onCorrupt: (qPath) => {
|
|
10036
|
+
void telegram?.createAttentionItem({
|
|
10037
|
+
id: `WS-LEDGER-CORRUPT-${Date.now()}`,
|
|
10038
|
+
title: 'Working-set pending-pull ledger was unreadable',
|
|
10039
|
+
summary: `The pending-pull ledger could not be parsed and was quarantined to ${path.basename(qPath)}. Stranded-recovery records may be lost — workspaces awaiting an offline machine may need a manual POST /coherence/fetch-working-set once that machine returns.`,
|
|
10040
|
+
category: 'agent-health',
|
|
10041
|
+
priority: 'NORMAL',
|
|
10042
|
+
lane: 'agent-health',
|
|
10043
|
+
sourceContext: 'working-set-handoff',
|
|
10044
|
+
}).catch(() => { });
|
|
10045
|
+
},
|
|
10046
|
+
onExpired: (rec) => {
|
|
10047
|
+
void telegram?.createAttentionItem({
|
|
10048
|
+
id: `WS-PULL-EXPIRED-${rec.topic}-${rec.epoch}`,
|
|
10049
|
+
title: `Topic ${rec.topic}'s working set was never recovered`,
|
|
10050
|
+
summary: `A working-set pull for topic ${rec.topic} from ${rec.nominee} stayed unrecoverable for the full retention window (reason: ${rec.reason}, ${rec.attempts} attempts). The files remain on ${rec.nominee}; bring it back online or run POST /coherence/fetch-working-set {"topic":${rec.topic}} once reachable.`,
|
|
10051
|
+
category: 'agent-health',
|
|
10052
|
+
priority: 'NORMAL',
|
|
10053
|
+
lane: 'agent-health',
|
|
10054
|
+
sourceContext: 'working-set-handoff',
|
|
10055
|
+
}).catch(() => { });
|
|
10056
|
+
},
|
|
10057
|
+
logger: (m) => console.log(pc.dim(` [working-set] ${m}`)),
|
|
10058
|
+
});
|
|
10059
|
+
const wsReader2 = new wsReaderMod2.CoherenceJournalReader({ stateDir: config.stateDir });
|
|
10060
|
+
const wsSelf = cjOwnMachineId ?? meshSelfId;
|
|
10061
|
+
const wsOwnerOf = (topic) => {
|
|
10062
|
+
const rec = sessionOwnershipRegistry?.read(String(topic));
|
|
10063
|
+
return { owner: rec?.ownerMachineId ?? null, epoch: rec?.ownershipEpoch ?? null };
|
|
10064
|
+
};
|
|
10065
|
+
workingSetPullCoordinator = new wscMod.WorkingSetPullCoordinator({
|
|
10066
|
+
stateDir: config.stateDir,
|
|
10067
|
+
ownMachineId: wsSelf,
|
|
10068
|
+
reader: wsReader2,
|
|
10069
|
+
ledger: wsLedger,
|
|
10070
|
+
ownerOf: wsOwnerOf,
|
|
10071
|
+
makePuller: (nominee, topic, epoch) => {
|
|
10072
|
+
const url = peerUrl(nominee);
|
|
10073
|
+
if (!url)
|
|
10074
|
+
return null;
|
|
10075
|
+
return new wsPullMod.WorkingSetPuller({
|
|
10076
|
+
stateDir: config.stateDir,
|
|
10077
|
+
send: async (cmd) => {
|
|
10078
|
+
const r = await meshClient.send({ machineId: nominee, url }, cmd, 0);
|
|
10079
|
+
if (!r.ok)
|
|
10080
|
+
throw new Error(`mesh ${r.status}: ${r.reason ?? 'error'}`);
|
|
10081
|
+
return r.result;
|
|
10082
|
+
},
|
|
10083
|
+
senderShortId: nominee,
|
|
10084
|
+
stillCurrent: () => {
|
|
10085
|
+
const o = wsOwnerOf(topic);
|
|
10086
|
+
return o.owner === wsSelf && o.epoch === epoch;
|
|
10087
|
+
},
|
|
10088
|
+
pullMaxBatchBytes: wsCfg?.pullMaxBatchBytes,
|
|
10089
|
+
chunkRestartCap: wsCfg?.chunkRestartCap,
|
|
10090
|
+
chunksPerTick: wsCfg?.chunksPerTick,
|
|
10091
|
+
busyRetryCap: wsCfg?.busyRetryCap,
|
|
10092
|
+
logger: (m) => console.log(pc.dim(` [working-set] ${m}`)),
|
|
10093
|
+
});
|
|
10094
|
+
},
|
|
10095
|
+
rearmConcurrency: wsCfg?.rearmConcurrency,
|
|
10096
|
+
logger: (m) => console.log(pc.dim(` [working-set] ${m}`)),
|
|
10097
|
+
});
|
|
10098
|
+
// The slow tick: TTL sweep + live-source re-arm (§3.4). 10 min.
|
|
10099
|
+
const wsSweepTimer = setInterval(() => {
|
|
10100
|
+
void workingSetPullCoordinator?.sweep().catch(() => { });
|
|
10101
|
+
}, 600_000);
|
|
10102
|
+
if (typeof wsSweepTimer.unref === 'function')
|
|
10103
|
+
wsSweepTimer.unref();
|
|
10104
|
+
// ── Peer-visibility guard (§3.6, the rider) ──
|
|
10105
|
+
// Improper revocations surface on boot + a registry recheck each
|
|
10106
|
+
// guard tick; disappearances are checked against the pool
|
|
10107
|
+
// registry's online view. All notices ride the agent-health
|
|
10108
|
+
// attention lane (coalescing, never topic-per-event).
|
|
10109
|
+
const guardMod = await import('../core/PeerVisibilityGuard.js');
|
|
10110
|
+
const visibilityGuard = new guardMod.PeerVisibilityGuard({
|
|
10111
|
+
stateDir: config.stateDir,
|
|
10112
|
+
selfMachineId: meshSelfId,
|
|
10113
|
+
strandedTopicsFor: async (machineId) => {
|
|
10114
|
+
const recs = await wsLedger.pendingForPeer(machineId);
|
|
10115
|
+
return [...new Set(recs.map((r) => r.topic))];
|
|
10116
|
+
},
|
|
10117
|
+
notify: (notice) => {
|
|
10118
|
+
void telegram?.createAttentionItem({
|
|
10119
|
+
id: `WS-GUARD-${notice.kind}-${notice.machineId}-${Date.now()}`,
|
|
10120
|
+
title: notice.title,
|
|
10121
|
+
summary: notice.body,
|
|
10122
|
+
category: 'agent-health',
|
|
10123
|
+
priority: 'NORMAL',
|
|
10124
|
+
lane: 'agent-health',
|
|
10125
|
+
sourceContext: 'peer-visibility-guard',
|
|
10126
|
+
}).catch(() => { });
|
|
10127
|
+
},
|
|
10128
|
+
logger: (m) => console.log(pc.dim(` [visibility-guard] ${m}`)),
|
|
10129
|
+
});
|
|
10130
|
+
// Boot check (§3.6.1) — the Mini's 10-invisible-hours case.
|
|
10131
|
+
try {
|
|
10132
|
+
visibilityGuard.checkRevocations(meshIdMgr.loadRegistry());
|
|
10133
|
+
}
|
|
10134
|
+
catch { /* @silent-fallback-ok: a guard boot-check failure must never block server boot; the guard-tick recheck covers it (WORKING-SET-HANDOFF-SPEC §3.6) */
|
|
10135
|
+
}
|
|
10136
|
+
const wsGuardTimer = setInterval(() => {
|
|
10137
|
+
try {
|
|
10138
|
+
const reg = meshIdMgr.loadRegistry();
|
|
10139
|
+
visibilityGuard.checkRevocations(reg);
|
|
10140
|
+
const expected = Object.entries(reg.machines ?? {})
|
|
10141
|
+
.filter(([, e]) => !e.revokedAt)
|
|
10142
|
+
.map(([id]) => id);
|
|
10143
|
+
const online = new Set((machinePoolRegistry?.getCapacities() ?? [])
|
|
10144
|
+
.filter((c) => c.online)
|
|
10145
|
+
.map((c) => c.machineId));
|
|
10146
|
+
void visibilityGuard.checkDisappearances(expected, online).catch(() => { });
|
|
10147
|
+
}
|
|
10148
|
+
catch { /* @silent-fallback-ok: the guard is observability — a failed tick is skipped, never compounds (WORKING-SET-HANDOFF-SPEC §3.6) */
|
|
10149
|
+
}
|
|
10150
|
+
}, 300_000);
|
|
10151
|
+
if (typeof wsGuardTimer.unref === 'function')
|
|
10152
|
+
wsGuardTimer.unref();
|
|
10153
|
+
console.log(pc.dim(' [working-set] pull coordinator wired (trigger + reflex + drain + sweep + visibility guard)'));
|
|
10154
|
+
}
|
|
10155
|
+
catch (e) { /* @silent-fallback-ok: working-set pull wiring failure degrades to serve-only (the verb still answers); never blocks server boot (WORKING-SET-HANDOFF-SPEC §4) */
|
|
10156
|
+
workingSetPullCoordinator = undefined;
|
|
10157
|
+
console.log(pc.dim(` [working-set] coordinator not constructed: ${e instanceof Error ? e.message : String(e)}`));
|
|
10158
|
+
}
|
|
10159
|
+
}
|
|
9962
10160
|
// ── Secret-sync OUTBOUND provisioner (push-on-provision, spec Phase 4) ──
|
|
9963
10161
|
// Constructed here (after meshClient + peerUrl exist). Encrypts the secret set
|
|
9964
10162
|
// PER online peer to that peer's X25519 key and pushes a signed `secret-share`.
|
|
@@ -10201,6 +10399,7 @@ export async function startServer(options) {
|
|
|
10201
10399
|
.map((m) => ({ machineId: m.machineId, url: peerUrl(m.machineId) })),
|
|
10202
10400
|
recordHeartbeat: (obs) => { machinePoolRegistry?.recordHeartbeat(obs); },
|
|
10203
10401
|
log: (line) => console.log(pc.dim(` [peer-presence] ${line}`)),
|
|
10402
|
+
onPeerRecorded: (machineId) => workingSetPullCoordinator?.onPeerRecorded(machineId), // working-set re-arm (§3.4); no-op when dark
|
|
10204
10403
|
fetchPeerCapacity: async (machineId, url) => {
|
|
10205
10404
|
const res = await meshClient.send({ machineId, url }, { type: 'session-status' }, 0);
|
|
10206
10405
|
if (res.ok && res.result && typeof res.result === 'object') {
|
|
@@ -10452,7 +10651,7 @@ export async function startServer(options) {
|
|
|
10452
10651
|
catch (err) {
|
|
10453
10652
|
console.log(pc.dim(` [session-pool] rollout gate not wired: ${err instanceof Error ? err.message : String(err)}`));
|
|
10454
10653
|
}
|
|
10455
|
-
const server = new AgentServer({ config, sessionManager, state, scheduler, telegram, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, localSigningKeyPem, leaseTransport, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, meshRpcDispatcher, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier });
|
|
10654
|
+
const server = new AgentServer({ config, sessionManager, state, scheduler, telegram, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, localSigningKeyPem, leaseTransport, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, meshRpcDispatcher, workingSetPullCoordinator, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier });
|
|
10456
10655
|
// Boot-recovery (tunnel-failure-resilience spec Part 6): if the agent
|
|
10457
10656
|
// died mid-relay-episode, the persisted tunnel.json carries
|
|
10458
10657
|
// rotationPending=true. Rotate the dashboard PIN + authToken BEFORE
|