instar 1.3.633 → 1.3.634
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 +59 -4
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +18 -1
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/LeaseCoordinator.d.ts +7 -0
- package/dist/core/LeaseCoordinator.d.ts.map +1 -1
- package/dist/core/LeaseCoordinator.js +9 -0
- package/dist/core/LeaseCoordinator.js.map +1 -1
- package/dist/core/MachinePoolRegistry.d.ts +8 -0
- package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
- package/dist/core/MachinePoolRegistry.js +1 -0
- package/dist/core/MachinePoolRegistry.js.map +1 -1
- package/dist/core/MultiMachineCoordinator.d.ts +69 -0
- package/dist/core/MultiMachineCoordinator.d.ts.map +1 -1
- package/dist/core/MultiMachineCoordinator.js +183 -0
- package/dist/core/MultiMachineCoordinator.js.map +1 -1
- package/dist/core/churnBreaker.d.ts +68 -0
- package/dist/core/churnBreaker.d.ts.map +1 -0
- package/dist/core/churnBreaker.js +98 -0
- package/dist/core/churnBreaker.js.map +1 -0
- package/dist/core/clockSkewAlarm.d.ts +61 -0
- package/dist/core/clockSkewAlarm.d.ts.map +1 -0
- package/dist/core/clockSkewAlarm.js +68 -0
- package/dist/core/clockSkewAlarm.js.map +1 -0
- package/dist/core/configCoherence.d.ts +39 -0
- package/dist/core/configCoherence.d.ts.map +1 -0
- package/dist/core/configCoherence.js +52 -0
- package/dist/core/configCoherence.js.map +1 -0
- package/dist/core/leaseLiveness.d.ts +42 -0
- package/dist/core/leaseLiveness.d.ts.map +1 -0
- package/dist/core/leaseLiveness.js +34 -0
- package/dist/core/leaseLiveness.js.map +1 -0
- package/dist/core/pollIntent.d.ts +65 -0
- package/dist/core/pollIntent.d.ts.map +1 -0
- package/dist/core/pollIntent.js +112 -0
- package/dist/core/pollIntent.js.map +1 -0
- package/dist/core/pollerCount.d.ts +61 -0
- package/dist/core/pollerCount.d.ts.map +1 -0
- package/dist/core/pollerCount.js +62 -0
- package/dist/core/pollerCount.js.map +1 -0
- package/dist/core/types.d.ts +57 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/lifeline/TelegramLifeline.d.ts +18 -0
- package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
- package/dist/lifeline/TelegramLifeline.js +99 -0
- package/dist/lifeline/TelegramLifeline.js.map +1 -1
- package/dist/lifeline/pollDecision.d.ts +47 -0
- package/dist/lifeline/pollDecision.d.ts.map +1 -0
- package/dist/lifeline/pollDecision.js +50 -0
- package/dist/lifeline/pollDecision.js.map +1 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +17 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +48 -48
- package/upgrades/1.3.634.md +59 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b1-lifeline-consumer.md +43 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b1-poll-decision.md +38 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b1-poll-intent-producer.md +37 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b2-churn-breaker.md +42 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b3-renew-timer.md +43 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b4-clockskew-alarm-core.md +25 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b4-d9-freeze-vs-skew.md +71 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b4-skew-immune-liveness.md +41 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b5-poller-count-route.md +24 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b5-poller-count.md +38 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-b5-pollingactive-heartbeat.md +38 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-ci-housekeeping.md +17 -0
- package/upgrades/side-effects/mm-lease-poll-robustness-config-coherence.md +23 -0
- package/upgrades/1.3.633.md +0 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAsH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA+EtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAy4CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAukftE;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
|
@@ -101,6 +101,9 @@ import { FencedLease } from '../core/FencedLease.js';
|
|
|
101
101
|
import { GitLeaseStore } from '../core/GitLeaseStore.js';
|
|
102
102
|
import { LocalLeaseStore } from '../core/LocalLeaseStore.js';
|
|
103
103
|
import { LeaseCoordinator } from '../core/LeaseCoordinator.js';
|
|
104
|
+
import { isPeerPresumedDead } from '../core/leaseLiveness.js';
|
|
105
|
+
import { readPollActive, pidAlive as pollPidAlive } from '../core/pollIntent.js';
|
|
106
|
+
import { checkMultiMachineConfigCoherence } from '../core/configCoherence.js';
|
|
104
107
|
import { HttpLeaseTransport } from '../core/HttpLeaseTransport.js';
|
|
105
108
|
import { HttpLiveTailTransport } from '../core/HttpLiveTailTransport.js';
|
|
106
109
|
import { LiveTailBuffer } from '../core/LiveTailBuffer.js';
|
|
@@ -3188,6 +3191,7 @@ export async function startServer(options) {
|
|
|
3188
3191
|
const coordinator = new MultiMachineCoordinator(state, {
|
|
3189
3192
|
stateDir: config.stateDir,
|
|
3190
3193
|
multiMachine: config.multiMachine,
|
|
3194
|
+
developmentAgent: config.developmentAgent,
|
|
3191
3195
|
});
|
|
3192
3196
|
const machineRole = coordinator.start();
|
|
3193
3197
|
if (coordinator.enabled) {
|
|
@@ -3195,6 +3199,13 @@ export async function startServer(options) {
|
|
|
3195
3199
|
if (machineRole === 'standby') {
|
|
3196
3200
|
console.log(pc.yellow(' Standby mode — processing gated, writes disabled'));
|
|
3197
3201
|
}
|
|
3202
|
+
// Phase 2 #7 — surface incoherent multi-machine config (WARN only, never a
|
|
3203
|
+
// boot reject): e.g. meshTransport off while session transfer is live (the
|
|
3204
|
+
// worst-of-both state from the 2026-06-20 audit), or duplicate mesh rope
|
|
3205
|
+
// priorities. Signal — the operator decides; boot is never blocked.
|
|
3206
|
+
for (const w of checkMultiMachineConfigCoherence(config.multiMachine, true)) {
|
|
3207
|
+
console.log(pc.yellow(` ⚠ config-coherence [${w.code}]: ${w.message}`));
|
|
3208
|
+
}
|
|
3198
3209
|
}
|
|
3199
3210
|
// ── Coherence Journal (COHERENCE-JOURNAL-SPEC §3.1/§3.3, P1.1) ─────────
|
|
3200
3211
|
// Per-machine append-only event streams (topic-placement / session-
|
|
@@ -3836,6 +3847,13 @@ export async function startServer(options) {
|
|
|
3836
3847
|
let liveTailReceiver;
|
|
3837
3848
|
const isGitRepo = fs.existsSync(path.join(config.projectDir, '.git'));
|
|
3838
3849
|
const gitBackupEnabled = config.gitBackup?.enabled !== false;
|
|
3850
|
+
// B4 (multimachine-lease-poll-robustness, Decision 10) — forward-ref to the
|
|
3851
|
+
// (later-constructed) MachinePoolRegistry so the lease-liveness closures can
|
|
3852
|
+
// read the SKEW-IMMUNE routerReceivedAt source instead of the skew-contaminated
|
|
3853
|
+
// registry lastSeen. undefined until the registry is built below — during that
|
|
3854
|
+
// window the closures fall back to lastSeen (safe). Function-body scope so it
|
|
3855
|
+
// is visible to BOTH the lease closures (deeper) and the registry assignment.
|
|
3856
|
+
let leaseLivenessRegistry;
|
|
3839
3857
|
// Construct gitSync for BOTH roles when this is a git-backed mesh machine:
|
|
3840
3858
|
// a standby needs it to pull, and a standby that later self-elects to awake
|
|
3841
3859
|
// (the Phase-0 scenario) must ALREADY have it so its role-change push fires.
|
|
@@ -4013,12 +4031,23 @@ export async function startServer(options) {
|
|
|
4013
4031
|
presumedDeadHolders: () => {
|
|
4014
4032
|
const reg = idMgr.loadRegistry();
|
|
4015
4033
|
const nowMs = Date.now();
|
|
4034
|
+
// B4 Decision 10 — skew-immune liveness when the flag resolves on AND
|
|
4035
|
+
// the in-process registry has actually observed the peer; else legacy
|
|
4036
|
+
// lastSeen. enabled OMITTED ⇒ developmentAgent gate.
|
|
4037
|
+
const skewImmune = resolveDevAgentGate(config.multiMachine?.leaseSelfHeal?.skewImmuneLiveness?.enabled, config);
|
|
4016
4038
|
const dead = new Set();
|
|
4017
4039
|
for (const [id, e] of Object.entries(reg.machines ?? {})) {
|
|
4018
4040
|
if (id === selfMachineId)
|
|
4019
4041
|
continue;
|
|
4020
|
-
const
|
|
4021
|
-
if (
|
|
4042
|
+
const cap = leaseLivenessRegistry?.getCapacity(id);
|
|
4043
|
+
if (isPeerPresumedDead({
|
|
4044
|
+
lastSeenMs: Date.parse(e.lastSeen),
|
|
4045
|
+
routerObserved: !!cap?.routerReceivedAt,
|
|
4046
|
+
routerOnline: !!cap?.online,
|
|
4047
|
+
nowMs,
|
|
4048
|
+
failoverThresholdMs: seamlessness.failoverThresholdMs,
|
|
4049
|
+
skewImmune,
|
|
4050
|
+
}))
|
|
4022
4051
|
dead.add(id);
|
|
4023
4052
|
}
|
|
4024
4053
|
return dead;
|
|
@@ -4052,9 +4081,18 @@ export async function startServer(options) {
|
|
|
4052
4081
|
const peerIds = Object.keys(reg.machines ?? {}).filter((id) => id !== selfMachineId && !reg.machines[id].revokedAt);
|
|
4053
4082
|
if (peerIds.length === 0)
|
|
4054
4083
|
return false; // a solo machine never "holds against" a peer
|
|
4084
|
+
// B4 Decision 10 — same skew-immune liveness as presumedDeadHolders.
|
|
4085
|
+
const skewImmune = resolveDevAgentGate(config.multiMachine?.leaseSelfHeal?.skewImmuneLiveness?.enabled, config);
|
|
4055
4086
|
return peerIds.every((id) => {
|
|
4056
|
-
const
|
|
4057
|
-
return
|
|
4087
|
+
const cap = leaseLivenessRegistry?.getCapacity(id);
|
|
4088
|
+
return isPeerPresumedDead({
|
|
4089
|
+
lastSeenMs: Date.parse(reg.machines[id].lastSeen),
|
|
4090
|
+
routerObserved: !!cap?.routerReceivedAt,
|
|
4091
|
+
routerOnline: !!cap?.online,
|
|
4092
|
+
nowMs,
|
|
4093
|
+
failoverThresholdMs: seamlessness.failoverThresholdMs,
|
|
4094
|
+
skewImmune,
|
|
4095
|
+
});
|
|
4058
4096
|
});
|
|
4059
4097
|
},
|
|
4060
4098
|
onSelfSuspend: (reason) => console.log(pc.yellow(` [lease] self-suspend: ${reason}`)),
|
|
@@ -14425,6 +14463,9 @@ export async function startServer(options) {
|
|
|
14425
14463
|
failoverThresholdMs,
|
|
14426
14464
|
logger: (m) => console.log(pc.dim(` [pool] ${m}`)),
|
|
14427
14465
|
});
|
|
14466
|
+
// B4 Decision 10 — hand the skew-immune registry to the lease-liveness
|
|
14467
|
+
// closures (forward-ref declared at function-body scope above the lease).
|
|
14468
|
+
leaseLivenessRegistry = machinePoolRegistry;
|
|
14428
14469
|
const poolSelfId = machineHeartbeat?.config?.machineId ??
|
|
14429
14470
|
(poolIdMgr.hasIdentity() ? poolIdMgr.loadIdentity().machineId : null);
|
|
14430
14471
|
// WS4.3 journal-lease cutover (MULTI-MACHINE-SEAMLESSNESS-SPEC §WS4.3,
|
|
@@ -14572,6 +14613,20 @@ export async function startServer(options) {
|
|
|
14572
14613
|
selfReportedLastSeen: new Date().toISOString(),
|
|
14573
14614
|
loadAvg: osMod.loadavg()[0],
|
|
14574
14615
|
quotaState: selfQuotaState(),
|
|
14616
|
+
// B5 — advertise this machine's REAL poll state (the lifeline's
|
|
14617
|
+
// truth file), so the pool's exactly-one-listener guard counts
|
|
14618
|
+
// actual pollers. undefined when the file is absent/stale or the
|
|
14619
|
+
// lifeline pid is dead (→ peers read it as unknown = fail-open).
|
|
14620
|
+
pollingActive: (() => {
|
|
14621
|
+
const pa = readPollActive(config.stateDir);
|
|
14622
|
+
if (!pa)
|
|
14623
|
+
return undefined;
|
|
14624
|
+
if (pa.pid && !pollPidAlive(pa.pid))
|
|
14625
|
+
return undefined; // dead lifeline → unknown
|
|
14626
|
+
if (Date.now() - pa.ts > 90_000)
|
|
14627
|
+
return undefined; // stale → unknown
|
|
14628
|
+
return pa.pollingActive;
|
|
14629
|
+
})(),
|
|
14575
14630
|
servesChannels: selfServesChannels(),
|
|
14576
14631
|
guardPosture: selfGuardPosture(),
|
|
14577
14632
|
// WS1.1 capability advertisement (spec invariant 5): a bounded
|