instar 1.3.502 → 1.3.503

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;AAgCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAyG7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAsBtD;;;;;;;;;;;;;;;;;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;AAyzCD,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,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AE,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,CA8dN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAumYtE;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"}
@@ -11381,6 +11381,19 @@ export async function startServer(options) {
11381
11381
  return null; /* @silent-fallback-ok — pool not wired yet → rule inert */
11382
11382
  }
11383
11383
  },
11384
+ // WS1.3: pin-conflict do-not-act — a pin naming THIS machine while the
11385
+ // owner is elsewhere means the reconciler is bringing the topic back;
11386
+ // the closeout holds instead of attacking the session the pin wants here.
11387
+ topicPinnedHere: (topicId) => {
11388
+ try {
11389
+ const self = _meshSelfId;
11390
+ const pin = _topicPinStore?.get(String(topicId));
11391
+ return !!self && !!pin && pin.pinned && pin.preferredMachine === self;
11392
+ }
11393
+ catch {
11394
+ return false; /* @silent-fallback-ok — no pin signal → hold not applied, closeout behaves as before */
11395
+ }
11396
+ },
11384
11397
  audit: reaperAuditSink(config.stateDir),
11385
11398
  },
11386
11399
  // developmentAgent gate (standard_development_agent_dark_feature_gate):
@@ -11998,6 +12011,72 @@ export async function startServer(options) {
11998
12011
  }
11999
12012
  },
12000
12013
  };
12014
+ // ── WS1.3 ownership reconciler (MULTI-MACHINE-SEAMLESSNESS-SPEC) ──
12015
+ // Bounded pin/owner convergence on a tick, replacing "wait for an
12016
+ // inbound message that delivery may never route" (the 2026-06-12 stuck
12017
+ // transfer-back). Dark + dry-run defaults; strict single-machine no-op
12018
+ // inside the module. Phase C: quorum logic is N-machine from day one.
12019
+ if (_topicPinStore && _meshSelfId) {
12020
+ const ws13Cfg = () => (config.multiMachine?.seamlessness ?? {});
12021
+ const { OwnershipReconciler } = await import('../core/OwnershipReconciler.js');
12022
+ const reconciler = new OwnershipReconciler({
12023
+ enabled: () => ws13Cfg().ws13Reconcile === true,
12024
+ dryRun: () => ws13Cfg().ws13DryRun !== false,
12025
+ selfMachineId: _meshSelfId,
12026
+ pinStore: _topicPinStore,
12027
+ ownership: ownReg,
12028
+ machines: () => {
12029
+ try {
12030
+ return (machinePoolRegistry?.getCapacities() ?? []).map((c) => ({
12031
+ machineId: c.machineId,
12032
+ online: !!c.online,
12033
+ lastSeenMs: c.selfReportedLastSeen ? Date.parse(c.selfReportedLastSeen) || 0 : 0,
12034
+ }));
12035
+ }
12036
+ catch {
12037
+ return []; /* @silent-fallback-ok — no pool view → module's single-machine strict no-op */
12038
+ }
12039
+ },
12040
+ isTopicBusy: (sessionKey) => {
12041
+ try {
12042
+ // Conservative safe-point signal: an inbound for this topic is
12043
+ // mid-processing. The bounded deadline in the module keeps a
12044
+ // false-busy from deferring forever.
12045
+ return currentInboundByTopic?.has(sessionKey) ?? false;
12046
+ }
12047
+ catch {
12048
+ return false; /* @silent-fallback-ok — unknown busy state defers to the module's bounded deadline */
12049
+ }
12050
+ },
12051
+ emitPlacement: (sessionKey, r, reason) => {
12052
+ try {
12053
+ const topicNum = Number(sessionKey);
12054
+ if (Number.isFinite(topicNum)) {
12055
+ state.getCoherenceJournal()?.emitPlacement(topicNum, {
12056
+ owner: r.record.ownerMachineId ?? '',
12057
+ epoch: r.record.ownershipEpoch,
12058
+ reason: 'reconcile',
12059
+ });
12060
+ }
12061
+ }
12062
+ catch { /* §3.3 pairing is observability — never endangers the CAS */ }
12063
+ },
12064
+ logger: (m) => console.log(pc.dim(` ${m}`)),
12065
+ });
12066
+ const tickMs = Math.max(5000, ws13Cfg().ws13TickMs ?? 30000);
12067
+ const ws13Timer = setInterval(() => {
12068
+ try {
12069
+ const rep = reconciler.tick();
12070
+ if (!rep.skipped && (rep.transfers || rep.claims || rep.forceClaims || rep.adoptions)) {
12071
+ console.log(pc.dim(` [OwnershipReconciler] tick: t=${rep.transfers} c=${rep.claims} f=${rep.forceClaims} a=${rep.adoptions}${rep.dryRun ? ' (dry-run)' : ''}`));
12072
+ }
12073
+ }
12074
+ catch (err) {
12075
+ console.error('[OwnershipReconciler] tick failed:', err instanceof Error ? err.message : String(err));
12076
+ }
12077
+ }, tickMs);
12078
+ ws13Timer.unref?.();
12079
+ }
12001
12080
  // Coherence journal §3.3: the emit is a thin wrapper at every CAS call
12002
12081
  // site — `reason` is caller knowledge (cas() is a storage primitive and
12003
12082
  // cannot know WHY). A mesh-applied action records the coarse reason;