instar 1.3.377 → 1.3.379

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiG7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA6JtD,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAs4BD,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,GAC/F,IAAI,CAyUN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmqTtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,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AAE,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"}
@@ -9730,10 +9730,15 @@ export async function startServer(options) {
9730
9730
  // git-backed cross-machine store is the Track-H swap). Per-session nonce set.
9731
9731
  const ownMod = await import('../core/SessionOwnershipRegistry.js');
9732
9732
  const seenOwnNonces = new Set();
9733
+ // Epoch floor (finding #7): late-bound — the journal reader that backs it
9734
+ // is constructed further down (working-set wiring); until then the floor
9735
+ // reads 0, which preserves pre-fix behavior for the boot window.
9736
+ let ownershipEpochFloor = null;
9733
9737
  sessionOwnershipRegistry = new ownMod.SessionOwnershipRegistry({
9734
9738
  store: new ownMod.InMemorySessionOwnershipStore(),
9735
9739
  seenNonce: (k) => seenOwnNonces.has(k),
9736
9740
  recordNonce: (k) => seenOwnNonces.add(k),
9741
+ epochFloorOf: (sk) => ownershipEpochFloor?.(sk) ?? 0,
9737
9742
  logger: (m) => console.log(pc.dim(` ${m}`)),
9738
9743
  });
9739
9744
  const ownReg = sessionOwnershipRegistry;
@@ -10167,6 +10172,20 @@ export async function startServer(options) {
10167
10172
  logger: (m) => console.log(pc.dim(` [working-set] ${m}`)),
10168
10173
  });
10169
10174
  const wsReader2 = new wsReaderMod2.CoherenceJournalReader({ stateDir: config.stateDir });
10175
+ // Bind the ownership epoch floor (finding #7): the newest JOURNALED
10176
+ // epoch for a topic — own + replica streams — so a post-restart
10177
+ // re-place on the in-memory registry never reuses an epoch the
10178
+ // journal's (topic, epoch) op-key already consumed (which silently
10179
+ // deduped the fresh placement evidence away, leaving the durable
10180
+ // record pointing at the WRONG machine).
10181
+ ownershipEpochFloor = (sk) => {
10182
+ const topicNum = Number(sk);
10183
+ if (!Number.isFinite(topicNum))
10184
+ return 0;
10185
+ const newest = wsReader2.query({ kind: 'topic-placement', topic: topicNum, limit: 1 }).entries[0];
10186
+ const e = newest?.data?.epoch;
10187
+ return typeof e === 'number' && Number.isFinite(e) ? e : 0;
10188
+ };
10170
10189
  const wsSelf = cjOwnMachineId ?? meshSelfId;
10171
10190
  const wsOwnerOf = (topic) => {
10172
10191
  const rec = sessionOwnershipRegistry?.read(String(topic));
@@ -10220,7 +10239,11 @@ export async function startServer(options) {
10220
10239
  return new wsPullMod.WorkingSetPuller({
10221
10240
  stateDir: config.stateDir,
10222
10241
  send: async (cmd) => {
10223
- const r = await meshClient.send({ machineId: nominee, url }, cmd, 0);
10242
+ // 30s per-attempt: pull pages carry up to 1MiB and the 5s
10243
+ // default was measured aborting every cold tunnel hop
10244
+ // (live-matrix T1) — each abort costs a pending-pull
10245
+ // round instead of milliseconds.
10246
+ const r = await meshClient.send({ machineId: nominee, url }, cmd, 0, { timeoutMs: 30_000 });
10224
10247
  if (!r.ok)
10225
10248
  throw new Error(`mesh ${r.status}: ${r.reason ?? 'error'}`);
10226
10249
  return r.result;
@@ -10339,7 +10362,11 @@ export async function startServer(options) {
10339
10362
  if (!url)
10340
10363
  return queue('owner unreachable (no known URL)');
10341
10364
  try {
10342
- const res = await meshClient.send({ machineId: ownerMachineId, url }, { type: 'commitment-mutate', payload }, 0);
10365
+ // 15s per-attempt: a cold tunnel hop was measured aborting the
10366
+ // 5s default on the FIRST call after idle (live-matrix T1) —
10367
+ // the ambiguous-outcome queue below then adds minutes of
10368
+ // latency to a mutation the warm link serves in <1s.
10369
+ const res = await meshClient.send({ machineId: ownerMachineId, url }, { type: 'commitment-mutate', payload }, 0, { timeoutMs: 15_000 });
10343
10370
  if (res.ok && res.result && typeof res.result === 'object' && 'verdict' in res.result) {
10344
10371
  await pendingMutationLedger.clear(payload.opKey);
10345
10372
  return { kind: 'verdict', outcome: res.result };