instar 1.3.378 → 1.3.380

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,CA2qTtE;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));