@cotal-ai/manager 0.64.0 → 0.65.0

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/manager.js CHANGED
@@ -6809,7 +6809,7 @@ export class Manager {
6809
6809
  ...(auth ? { evict: makeManagerEndpointHolderEvictor({ space: this.space, servers: this.servers ?? DEFAULT_SERVER, auth, log: (line) => console.error(line), unreachableWaitMs: DELIVERY_ADMIN_BOOT_WAIT_MS }) } : {}),
6810
6810
  });
6811
6811
  const spec = { endpoint: MANAGER_ENDPOINT, owner: DEV_OWNER, clusterDigests: [artifacts.closureDigest], protocol: { v: 1 } };
6812
- const { registrationRevision } = await registerServiceInstance(recordsKv, {
6812
+ const { registrationRevision, processEpoch } = await registerServiceInstance(recordsKv, {
6813
6813
  space: this.space, spec, instanceId: iid, registrant: { owner: DEV_OWNER }, authority, barrier, readClusterArtifact,
6814
6814
  // #1393: when a FOREIGN instance holds the endpoint governance slot, let core tell an
6815
6815
  // in-flight registration from one abandoned by a predecessor that died between its
@@ -6818,14 +6818,13 @@ export class Manager {
6818
6818
  // reopened past the slot's stamp.
6819
6819
  observeHolderGeneration: (holderInstanceId) => readEndpointGateGeneration(authKv, { endpoint: MANAGER_ENDPOINT, instanceId: holderInstanceId }),
6820
6820
  });
6821
- // processEpoch comes from the GATE (checklist 4: never derived from the uid string); the
6822
- // fence below is also the mint's §13.1 release CAS.
6821
+ // processEpoch is the one this registration's reopen committed (checklist 4: never derived
6822
+ // from the uid string). A gate read here could already show a successor's epoch; the fences
6823
+ // below refuse that successor instead of serving at it. The fence is also the mint's §13.1
6824
+ // release CAS.
6823
6825
  const fence = serveIssuanceGateKv(authKv, this.space, { endpoint: MANAGER_ENDPOINT, instanceId: iid });
6824
- const observed = await fence.observe();
6825
- if (observed === null)
6826
- throw new Error(`the issuance gate for ${MANAGER_ENDPOINT}/${iid} vanished after registration`);
6827
6826
  const grant = await authorizeServeGrant(recordsKv, {
6828
- space: this.space, endpoint: MANAGER_ENDPOINT, instanceId: iid, epoch: observed.processEpoch,
6827
+ space: this.space, endpoint: MANAGER_ENDPOINT, instanceId: iid, epoch: processEpoch,
6829
6828
  holder: { owner: DEV_OWNER }, authority, readClusterArtifact,
6830
6829
  readProcessEpoch: async () => {
6831
6830
  const g = await fence.observe();
@@ -6841,10 +6840,10 @@ export class Manager {
6841
6840
  // restart it CAS-updates the predecessor's status forward (the advanced epoch supersedes the old
6842
6841
  // one). Key-pinned to this instance's own status key on the SAME executor.
6843
6842
  await writeServiceStatus(recordsKv, {
6844
- endpoint: MANAGER_ENDPOINT, instanceId: iid, epoch: observed.processEpoch,
6843
+ endpoint: MANAGER_ENDPOINT, instanceId: iid, epoch: processEpoch,
6845
6844
  status: {
6846
6845
  state: SERVICE_READY,
6847
- epoch: observed.processEpoch,
6846
+ epoch: processEpoch,
6848
6847
  observedSpecRevision: registrationRevision,
6849
6848
  connectors: this.connectorStatuses.map((row) => ({ ...row, binaries: { ...row.binaries } })),
6850
6849
  },